This is a migrated thread and some comments may be shown as answers.

Row Select/Check Issue

4 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SDI
Top achievements
Rank 1
SDI asked on 31 Dec 2011, 10:03 PM
Happy New Year Telerik!

I have a grid with a RowSelected client event that fills in other controls on the page. The grid has a "clientselectcolumn". On loading I populate the grid with serverside code. I also fire a "item.selected = true" in the PreRender, which successfuly checks the first row and "clientselectcolumn" column, but it doesnt fire the RowSelected that fills in the controls on the page.

How can I go about checking and selecting the first row and filling in the other controls on the page load? I also want to implement this on the ItemCreated, so it checks the new row and fills in the default data I set on the postback for the other controls. This data is set up in the grid with the Client/DataKeyNames in a single query and on the RowSelected it fills in the other page controls.

Thanks!
SDI

4 Answers, 1 is accepted

Sort by
0
Accepted
Antonio Stoilkov
Telerik team
answered on 03 Jan 2012, 02:46 PM
Hello,

You could achieve your scenario by following the steps below:
  • Select the needed items server-side
  • Access the selected items client-side by calling get_selectedItems() of the MasterTableView as it is shown below. Note that there is no way to call the client-side event when server-side selection is made.
$find("RadGrid1").get_masterTableView().get_selectedItems()

All the best,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
SDI
Top achievements
Rank 1
answered on 04 Jan 2012, 02:17 AM
I actually needed to have a java function that populates the controls. It had to be on load and when items got created, 
I was able to achieve this by:

jQuery( function ()
{
SetProgramFormData();
});
I use the ".get_selectedItems(keyfieldvalue) in the SetProgramFormData(); function to get the item values and put them in the controls. That way I can use it on other client-side events.

Thanks Antonio

0
SDI
Top achievements
Rank 1
answered on 26 Jun 2012, 01:36 PM
I want to be able to select a row WITHOUT the grid checking the GridClientSelectColumn checkbox. I have 2 columns - 1 is the GridClientSelectColumn and the other is a GridBoundColumn. The user clicks on the BoundColumn and it fills in some data somewhere else, but should not check the SelectColumn. The 'UseClientSelectColumnOnly' obviously does the checkbox only, but I need the BoundColumn to be selectable and change the CSS to the SelectedRow property as the SelectColumn does. The user will then know the row they are on BUT its not checked to be used in the rest of the forms process.

Thanks for the help
SDI
0
SDI
Top achievements
Rank 1
answered on 26 Jun 2012, 03:46 PM
We re-thought the issue and the Grid is too big of a footprint for this anyway. We switched to a RadListBox which has the desired functionality pretty much built-in.

Thanks!
SDI
Tags
Grid
Asked by
SDI
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
SDI
Top achievements
Rank 1
Share this question
or