I have got a devexpress gridview with Selection Enabled.
Is it possible that, on a Button click to check whether rows are selected or not from clientside.
If not prpmpt alert saying--> 'NO ROW IS SELECTED'
Basically i need to loop through gridview from client side and check if selected or not.
Can this be done. If so please help me out.
Yes, it is possible. You should call the GridView's client side GetSelectedRowCount() method to determine the number of rows selected in the ASPxGridView.
bool value = Convert.ToBoolean(gvMain.SelectedRowsCount);
Related
I'm getting a weird behavior with a dropdownlist when I trigger a postback.
If the dropdownlist is enabled, the selected value remains the same after a postback.
However, if the dropdownlist is disabled (via a javascript when user ticks a checkbox), then the selected value is reset to the first item in the list.
How come ?
you need to look up the value manually (probably store it in another field or so), and then set it yourself in the code behind. This is because if a control is disabled, the value would not be posted back to the sever.
Check out this question, and refer to the first answer by Pavan
how to get selected value of Disabled dropdown in c#
If you are trying to read the value of 2nd dropdown (disabled one) at
server, you will never be able to read the updated value, becuase data
in disabled controls will not be posted back to server from client
I have textbox with event textchanged and autopostback is true, when textbox get value from return value dialog telerik event textchange not working (not postback whereas value text was change)
Thanks in advance
I assume the textbox is getting the text from the Telerik control and that it's working?
Is your viewstate enabled?
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.textchanged.aspx
Also, you might want to check this thread out:
http://forums.asp.net/t/1123520.aspx/2/10
Depending on how you have your code written (which is impossible to tell because you haven't given any) you will probably have to TAB out of the textbox in order for the update to happen. You will most likely need to use some javascript to help you here.
I have a gridview with paging enabled. I want to hide some rows based on a condition: if id == "such value", I want to set e.row.visible = false; in the RowDataBound event.
I have succeed to do that, but the problem that I want the paging to be effected? If page one of the grid has a rows that will be hided so page two take its place.
please help , thanks
I am not sure you can implement it this way. However, there is another approach.
I chose one row to click select button in grid view and click to submit button to go next page. Then, I want to get selection grid view id from grid view page. How I do?
I think the easiest way is to pass the selection as a query argument to the second page.
You can use the GridView OnRowCommand event to fetch the datasource bounded to that particular row. From that you can take the for that particular row. Pass this to the second page either through querystring or session .
Thanks
I am populating a telerik:RadGrid from a DataTable. Each of the DataRows in the DataTable has a "readonly" column with a value of true or false.
The grid currently has a GridEditCommand column, and a GridButtonColumn that triggers the "Delete" command.
What I need is for rows that display records for which "readonly" is true to be read-only. I need the icon in the GridEditCommand column to be different, and for clicking it to bring up a view-details form, instead of an edit form. And I need the link in the "Delete" GridButtonColumn to be absent.
It looks like it'd be pretty straightforward to create a table that doesn't allow the user to edit or to delete records, but I need to be able to have some rows editable and some not.
Where should I start?
This is possible; I'd recommend on the left, the image be a command button, and you trigger the right action depending on the selection you make in itemcommand event. To change the icon, you'd need to tap into the rowdatabound event and programmably change it. Now for showing view details, I don't know if the Telerik grid has something built-in for the read-only view; this may have to be programmably done with a control outside of the grid.
HTH.