I just want to extract data from the selected row.
It would seem this would be a function of a datagrid (it is of THE Datagrid).
But, I cannot find a complete example so far. I have been reading for some time.
Can someone point me to where there might be a visual c example program?
Thank you
Hi tschmitz
To get a reference to the selected row you have first to verify that you have set the DataKeyField-Property of the UltraWebGrid to an apropriate value. Without this it won't work.
Then you can use the SelectedRows-Collection of the DisplayLayout to get a reference to the selected row(s) as like:
int addressPk = Convert.ToDecimal(AddressResultGv.DisplayLayout.SelectedRows[0].DataKey);
Hope this helps
RegardsAdrian
I appreciate the responses that I got on this problem.
Unfortuneatly, I am a total beginner to this type of programming. I needed a step-by-step example. I had no luck at all finding one.
I was able to finally get an answer to this through support. Having said all that, I am going to post the steps I took in C# on an ASP.NET page, below.
//
1. Start new Visual C# - ASP.NET project in Visual Studio 2005
2. Add an UltraWebGrid control to “Design page” in Visual Studio.
3. Additional References MUST be added in order for UltraWebGrid to work. As there is still a bug in the Infragistics controls.
While in Visual Studio, display the “Solution explorer” and add references as follows.
a. right-click on “References”
b. select “Add References”
c. click on the “.Net” tab
d. scroll down the list of References until you see Infragistics
e. select and add the following additional references for an UltraWebGrid control
1. Infragistics2.Web.v8.1
2. Infragistics2.WebUI.Misc.v8.1
3. Infragistics2.WebUI.Shared.v8.1
(the Infragistics2.WebUI.UltraWebGrid.v8.1 “should” already be there, if you have placed a grid on the Design page)
4. Add a listbox control to the “Design page” (to display selected data)
5. Add a label control to display any messages.
6. Now some Events MUST be added for the UltraWebGrid. These MUST be added through “Properties à Events” or they WILL NOT WORK.
a. click on UltraWebGrid1, on the “Design page”.
b. right-click while on UltraWebGrid1. Choose “properties”
c. While in the properties menu in Visual Studio 2005, click
on the “Events” icon, identified by a lightening bolt.
d. scroll down the list of events until you locate “InitializeLayout”.
e. Now in the blank next to IntializeLayout, type
“UltraWebGrid1_IntializeLayout”, then <enter>. This will PROPERLY add a
section for this Event to the C# code.
f. Next return to the list of events for the UltraWebGrid and locate “IntializeDataSource”.
g. Now in the blank next to InitializeDataSource type
“UltraWebgrid1_IntializeDataSource” then <enter>. This will PROPERLY add
a section to the C# code for this Event.
h. Return one more time to the list of Events for the UltraWebGrid and locate
“DblClick”.
i. In the blank next to DblClick, type
“UltraWebGrid1_DblClick” then <enter>. This will PROPERLY add a section for this Event to the C# code.
7. Now there is one section which must be typed in; So, just type in the following,
in its entirety, to the C# code.
b. Add the following code to the “UltraWebGrid1_InitializeDataSource” section of the
C# code.