8 Answers, 1 is accepted
0

Emanuel Varga
Top achievements
Rank 1
answered on 12 Aug 2010, 03:28 PM
Hello Jayanthi,
You can add it like this:
Best Regards,
Emanuel Varga
You can add it like this:
var checkBoxColumn = new GridViewCheckBoxColumn();
checkBoxColumn.HeaderText = "Checked";
radGridView1.Columns.Insert(0, checkBoxColumn);
Best Regards,
Emanuel Varga
0

jayanthi
Top achievements
Rank 1
answered on 13 Aug 2010, 11:28 AM
Hello Emanuel Varga,
Thank you for your reply.
Am displaying records from database during runtime, boolean field is shown as checkbox column in Radgridview. Am developing in windows.
I have 3 columns in gridview. First 2 are not editable and 3rd is check box column.
My requirement is that check box has to be like Radio button, ie; at a time only one check box has to checked.
I am able to do it but i have the below problems,
Thank you for your reply.
Am displaying records from database during runtime, boolean field is shown as checkbox column in Radgridview. Am developing in windows.
I have 3 columns in gridview. First 2 are not editable and 3rd is check box column.
My requirement is that check box has to be like Radio button, ie; at a time only one check box has to checked.
I am able to do it but i have the below problems,
- I couldnt edit the check box in first click if it is not in editable mode
- Is it possible to check the check box in key down event using UP/DOWN arrow
- How to get the previous row index?
- If i print the current row check box value, it displays the previous value ie, value am selecting is not getting update. How to get that value?
It will be very helpful if u provide me the answer soon
Thanx
Jay
0

Emanuel Varga
Top achievements
Rank 1
answered on 13 Aug 2010, 01:05 PM
Hello again jayanthi,
If i understood correctly what you want to do you can use the CurrentRowChanging event to accomplish this: a code that does this, more specifically it checks the checkbox for the selected row and deselects the checkbox for the previous row.
For this to work even if the user clicks the checkbox you can set the column ReadOnly to true (the cells[0] is the checkbox column, previous row and current row are also available here if you need them.
Snippet
If i understood correctly what you want to do you can use the CurrentRowChanging event to accomplish this: a code that does this, more specifically it checks the checkbox for the selected row and deselects the checkbox for the previous row.
For this to work even if the user clicks the checkbox you can set the column ReadOnly to true (the cells[0] is the checkbox column, previous row and current row are also available here if you need them.
Snippet
void radGridView1_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
{
var previousRow = e.CurrentRow;
var currentRow = e.NewRow;
previousRow.Cells[0].Value = false;
currentRow.Cells[0].Value = true;
}
0

jayanthi
Top achievements
Rank 1
answered on 16 Aug 2010, 05:10 AM
Hi,
really thanx for ur solution.
Now i can uncheck the previously selected check box.
Now my problem is;
if the row is not in edit mode, then i couldt change the status of check box in single click.
How to achieve it in windows?
Thanx
Jay
really thanx for ur solution.
Now i can uncheck the previously selected check box.
Now my problem is;
if the row is not in edit mode, then i couldt change the status of check box in single click.
How to achieve it in windows?
Thanx
Jay
0

Emanuel Varga
Top achievements
Rank 1
answered on 16 Aug 2010, 07:23 AM
Hello again,
Can you please rephrase your question about edit mode? Do you want to check the checkbox for the edited row or uncheck the checkbox for an edited row?
Best Regards,
Emanuel Varga
Can you please rephrase your question about edit mode? Do you want to check the checkbox for the edited row or uncheck the checkbox for an edited row?
Best Regards,
Emanuel Varga
0

jayanthi
Top achievements
Rank 1
answered on 16 Aug 2010, 07:51 AM
Hello,
Check or uncheck the checkbox column in single click if the row is not in edited mode.
If the radGridView is not in edited mode then to check/uncheck the checkbox column , i have do 3 clicks
Check or uncheck the checkbox column in single click if the row is not in edited mode.
If the radGridView is not in edited mode then to check/uncheck the checkbox column , i have do 3 clicks
- for focus
- for edit mode
- then in 3rd click only it change the check state of checkbox.
Is it possible to change the checkbox check state in a single click
Thanx
Jay
0

Nadine
Top achievements
Rank 1
answered on 17 Aug 2010, 02:27 PM
Hi,
I have the same problem... changing checkstate is only wirking fine at the first time. After this I have to click more times to fire the event.
Nadine
I have the same problem... changing checkstate is only wirking fine at the first time. After this I have to click more times to fire the event.
Nadine
0
Hello everyone,
I have managed to reproduce some inconsistent edit behavior and it seems that we have an issue appearing when a CheckBox column is bound. We will investigate this further and address it in a future release. Please excuse us for the caused inconvenience.
Kind regards,
Martin Vasilev
the Telerik team
I have managed to reproduce some inconsistent edit behavior and it seems that we have an issue appearing when a CheckBox column is bound. We will investigate this further and address it in a future release. Please excuse us for the caused inconvenience.
Kind regards,
Martin Vasilev
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