Hi Nixfon1234,
In the initializeLayout event, i think it is correct. But what I would recommend is instead of add in this checkbox column during run time, add it in through the design this way you'll know for sure that it is there then once everything is working, then you can switch it over to adding in the checkbox at runtime. All of the property for the checkbox, you can assign it during the design as well.
So, from the code that you listed above, you are trying to capture the checkbox value during the Button1_Click event right??
Just so you know that I developed my code in C# so the code that I gave you in 2 posting ago is exactly what I use in my code and I'm not familiar with the Infragistics syntax in VB.Net but I assumed that they are pretty close.
So, I am going to do this one line at a time using my code and the sample code you provided.
VB: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
C#: Protected void Button1_Click(object sender, EventArgs e){
Dim blnStatus As Boolean = False
Dim SelRow As String
Dim dgdRow As Infragistics.WebUI.UltraWebGrid.UltraGridRow
VB: For Each dgdRow In StatusGrid.Rows
C#: foreach(UltraGridRow row in Ultrawebgrid1){
VB: SelRow = dgdRow.Cells.FromKey("CheckBox").Value.ToString() C#: sChecked = row.Cells.FromKey("CheckBox").Value.ToString();
Next
End Sub
}
Can you create a brand new .aspx page, throw an ultrawebgrid on and create two columns, col1, col2 – set this one as a CheckBox column. Please do all of this during the design rather than runtime. Then bind some data to col1 so that way for each row of data for col1, it has a checkbox. In my checkbox, I have AllowUpdate = Yes, Type = CheckBox, DataType = System.String, Key = CheckBox1
Add a button on the screen and give it an event of Button1_Click event and add the foreach loop into the Button1_Click event method. During runtime, select (check) on checkbox for a row, then click Button1 and then slowly step it through to see if you can see the value.
If you convert my C# into VB.Net, it should work fine and the row that you have checked should now be true and the rows that you don't have the checkboxes checked, should be false. The foreach loop should loop through each row on the webgrid. If you want to know what row you are viewing the value, you can set the value the row.Index property inside the for loop.
From your code and what I have seen, there is nothing wrong with your code.
Good luck and let me know how it goes!!!
HS2