how to get selected row value at server side
i uase ultrawebgrid and i want selected row value on one button click
UltraWebGrid1.DisplayLayout.SelectedRows; -> Gives you a collection of selected rows (can be more than one)
UltraWebGrid1.DisplayLayout.ActiveRow; -> Gives you te actual active row. This method always returns just one row.
i used that one but it's wan't wrok for me
can u give me some expamle of that coding
and any properties i have to set for that webgrid
Hi all
Thanks for all these help
InitializeDataSource event it's wroks perfectly
i aprriciate all help from you guys
Thanks
Hello,
I think the problem here is that databinding occurs prior to executing the postback event handler that gets the selected rows. The problem is that databinding essentially clears the selected rows collections (empties the grid and rebinds again).
You can try moving the code databinding the grid from Page_Load to the grid InitializeDataSource event. Also, you can check the lifecycle of the page.
I believe a very similar thread with a similar problem is discussed (SelectedRows.Count = 0 even when rows are selected) here:
http://forums.infragistics.com/forums/p/11104/42129.aspx
I don't seem to get what the problem could be.. If you have at least one row selected it should be already in the SelectedRows colection.. Have you tried with the ActiveRow too? As I told you this one returns the single row that has the focus at that moment. Althog by the code you provided, I also do not see the functionality you're trying to achieve. Maybe you could try to explain a little bit more your scenario and specify if there's any other control in te equation.
Here is heml code
<bands>
<igtbl:UltraGridBand>
<Columns>
<igtbl:UltraGridColumn Type="Button">
<header caption="Select">
</header>
</igtbl:UltraGridColumn>
IsBound="True" Key="FirstName">
<header caption="FirstName">
<rowlayoutcolumninfo originx="1" />
<footer>
</footer>
IsBound="True" Key="LastName">
<header caption="LastName">
<rowlayoutcolumninfo originx="2" />
</Columns>
<addnewrow view="NotSet" visible="NotSet">
</addnewrow>
</igtbl:UltraGridBand>
</bands>
Thanks ofr all these halp
but it's still not wroking , i did put a bracke point over ther and tryed to see how many rows i got , but it's count 0
If UltraWebGrid1.DisplayLayout.SelectedRows.Count > 0 Then
UltraWebGrid1.DisplayLayout.SelectedRows(0).Hidden = True
UltraWebGrid1.DisplayLayout.SelectedRows(0).Selected = False
End Sub
one more thing i that i select row before trigger this event or button click
i also set a cellclick = rowselect properties
but i don't understand y it's not working
shuold i need to set any properites in grid
i bound the data like this way
UltraWebGrid1.DataSource = percol.getdata
UltraWebGrid1.DataBind()
This is the getdata Method of DAL Class
per.FirstName = ""
per.LastName = ""
per1.FirstName = "ashish"
per1.LastName = "patel"
percol.Add(per)
percol.Add(per1)
End Function