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

Excel-Like Grid With Numbers only Promblem

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chad Canterbury
Top achievements
Rank 1
Chad Canterbury asked on 22 Oct 2010, 10:26 PM
If is basically to document what I found. I don't know if it is a bug or not, I believe it is just a flaw in the design. But this hopefully will save someone time by not having to troubleshoot for hours like I did.

I used the example of Excel-like RadGrid because it was exactly what I wanted. HOWEVER, it is for text only columns in a database. I found that when binding to the database without hard coding in the columns on the .aspx page the grid will imply a column type (nvarchar = textbox, float=RadNumericTextBox, etc...). This is fine, but there are different naming conventions for each.

Textboxes will have names like RadGrid1_ctl00_ctl04_ctl02, RadGrid1_ctl00_ctl04_ctl03, RadGrid1_ctl00_ctl04_ctl04, while NumericTextBox will have names like RadGrid1_ctl00_ctl04_RNTB_EmpID, RadGrid1_ctl00_ctl04_RNTB_EmpAge. This makes the navigation impossible with databases with numeric values, as in the example to move right you increment the name by one:
    Active Cell RadGrid1_ctl00_ctl04_ctl02 -> to move right increment RadGrid1_ctl00_ctl04_ctl02 becomes RadGrid1_ctl00_ctl04_ctl03.

My question is: is there a way to change the naming convention of the RadNumericTextBox without casting the column on the SQL call?

I can work around it by using Shift-tab/Tab for Left/Right and since the 3rd ctl99 subset is the row, I can move up and down. And I have not tried it yet, but I am sure you can just get the cell location (i.e. row 2, cell 3) and move it that way by getting the control id in the adjacent cell, but Just wondering if there is a way to make NumericTextBox have the same naming convention as TextBox ?  


1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 27 Oct 2010, 02:18 PM
Hello Tony,

Unfortunately the RadControls do not support the desired functionality concerning changing the naming convention of the controls' IDs.
To achieve the desired functionality you could try using jQuery and add custom css class to every control, which could contains the row number and column number to which the control belongs. Then you could change the client side logic of navigation and get elements by css class instead of getting them by ID.
Please give it try and let me know if you experience any problems.

All the best,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Chad Canterbury
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or