Form template with controls as TabPage - sql-server

I have a tabpage which displays a summary of records in my database, when the user clicks a row a new tabpage opens, this uses a form as a 'template' which has textboxes, the textboxes will display the detailed data from the specific row.
The stumbling point I am at is I can get to the point where the new tabpage opens with the form template displayed but I dont know how to fill the textboxes on the new tabpage / form with the data from the database (based on the row the user selected). How do I reference the textboxes on the new tabpage and assign them the appropriate fields? Do I bind the 'templates' textboxes and then fill them with a query?
I have tried this...
Me.tabMain.TabPages(NewTab).Controls(frmRecipeDisplay.Controls(txtVersion).Text = "test")
But this causes an error.
This app is in VB.NET.
Any help is appreciated.

Related

How to load content into dynamically created TabItems On-Demand/Lazy Load?

I have a tab control defined in my app and I'm adding tab items to it dynamically. Lets say I have list of objects with lots of data and for each object I show 5-10 tabs. The ordering and the tabs shown differ from object to object. That is why I have to dynamically create these tabs based on my object.
As far as the content inside these tab items go, I generally set the .Content property of each tab to a UserControl and it loads it as shown in below code.
If ContainsFingerprints() Then
Dim fingerprintT As New TabItem
fingerprintT.Content = New FingerprintTab()
fingerprintT.Header = "Fingerprints"
fingerprintT.Name = "tiFingerprintTab"
viewTab.Items.Add(fingerprintT)
End If
Some of these tabs have lots of images and take up lot of memory at run time. That is why I would like to load Content in those tab items 'on-demand', that is, only when the tab is selected.
I could use the SelectionChanged event of the tab control and then load the required content but is there a better solution that WPF offers?

get ValueField from ComboBox

i have a grid with much entries, when i select an entry a new window with a form will open, which contains the values from the selected grid row. Now i can edit the parameters and save them into a database.
var form = btn.up().up().down('[name="eingabeformular"]').getForm();
form.getValues()
With the code above i will get all the data´s from my form entries, but only from the ComboBox, this will return ever the display field but i need the data´s!
is there any parameter in the Combobox or how can i do that??

Simulate a click event on a grid row

How can I dynamically click rows in my grid?
E.g.: I am using border layout.
I have a grid in the west with a list of Companies.
When I click on a Company, the information of the company which has an Id, is displayed in a form in my center area.
Now, when I want to add a company ( I am doing this with a button which opens a "Add window"), and type all information in the form and then press "save", I reload the grid.
How could I make it, that the company which is newly added, is clicked on and its information is displayed in the center area.
NOTE: The companies are listed with an ajax request, and the information is called with a "onCompanyGridHandler".
You can make the new campany created added in the top of the grid by sorting the grid's store with, for example, the date of campany creation. You can so add this line in the grid's store:
sorters: { property: 'datecreate', direction : 'DESC' },
Then, after the campany creation, you select the first row of the grid, using this code:
Ext.getCmp('your_grid_id').getView().select(0);
There are a couple of approaches you can take here:
In the function where you add the data from the Add Window to the grid panel's store, you can also get the form and use the form's loadData() method to load the data into the form, populating both the Grid and Form at the same time.
As is mentioned in a comment, after adding the data to the grid's
store, make fire the click event on the row in the grid that is
displaying the new data. I prefer the first approach because you do
not have to find the correct row in the grid and fire its click
event. In the first approach both the grid and form are loaded
with the data directly.
David

On Click on the RowHeader the current row should be editable and On click of the columnHearder current column of all row should be editable

I have a silverlight DataGrid, by default on page load the all the cells of the datagrid should be Readonly. I have 2 problem , can any one help me?
1.On Click on the RowHeader the current row should be editable
2. On click of the columnHearder current column of all row should be editable
This might not solve your entire problem but it should partially address it.
This is to make a column read-only in a datagrid
DataGrid.Columns[7].IsReadOnly = true;
Obviously the property can be changed from events but the data grid does not have row/column headers event handlers. Custom controls seem the way to go without introducing any new gui elements like buttons and changing the feel of the application.

Silverlight autocompletebox validate item selected

I just need to validate that at least one item in an autocompletebox has been selected (meaning the textbox is not blank) when a button is clicked.
My list etc is working fine ... Im just not sure how to do validation. In fact this is the first of any such silverlight validation I've done as the bulk of our work is readonly dashboard type screens.

Resources