I have a grid in which the combobox column's value are dependant on another value in the row.
i.e.
Row 1 has value 1; combo should display a,b,c,d
Row 2 has value 2; combo should display e, f, g
I have the combo bound to a stored procedure with a parameter, but where can I specify the parameter to pass for the procedure.
I tried modifying the DataSource on CellBeginEdit, but for the rows not of the same type the combobox field goes blank as their value is no longer valid when the new dataset is put in place. I tried changing the dataset back in the CellEndEdit, but that didn't seem to work.
Thanks,
Eric
i.e.
Row 1 has value 1; combo should display a,b,c,d
Row 2 has value 2; combo should display e, f, g
I have the combo bound to a stored procedure with a parameter, but where can I specify the parameter to pass for the procedure.
I tried modifying the DataSource on CellBeginEdit, but for the rows not of the same type the combobox field goes blank as their value is no longer valid when the new dataset is put in place. I tried changing the dataset back in the CellEndEdit, but that didn't seem to work.
Thanks,
Eric
18 Answers, 1 is accepted
0
Hi Eric,
I could not completely understand the part mentioning that "the rows not of the same type". Could you please be more specific about your setup.
Regarding the CellBeginEdit event, you could try casting the sender parameter to GridCellElement (or GridDataCellElement) and then use the ViewTemplate property of the cell to determine which is the template and what is the type of data and if you can set your data source.
In order to provide additional assistance, I will need more information about your scenario. Please send a sample project to help me reproduce the issue locally.
I'm looking forward to your response.
Sincerely yours,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I could not completely understand the part mentioning that "the rows not of the same type". Could you please be more specific about your setup.
Regarding the CellBeginEdit event, you could try casting the sender parameter to GridCellElement (or GridDataCellElement) and then use the ViewTemplate property of the cell to determine which is the template and what is the type of data and if you can set your data source.
In order to provide additional assistance, I will need more information about your scenario. Please send a sample project to help me reproduce the issue locally.
I'm looking forward to your response.
Sincerely yours,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Software
Top achievements
Rank 1
answered on 28 Mar 2008, 02:14 PM
I have two tables similar to this
Table 1:
EmployeeID EmployeeTypeCode TitleCode
1 1 1
2 1 2
3 2 3
4 2 4
Table2:
Title Code Title EmployeeTypeCode
1 Supervisor 1
2 Manager 1
3 Assembler 1 2
4 Assembler 2 2
I have the Combo tied to table 2 for the members and the datafield to TitleCode from table1
When editing a row where EmployeeType = 1 I only want to be able to select items from table 2 where EmployeeTypeCode = 1 etc.
Does this make more sense?
Table 1:
EmployeeID EmployeeTypeCode TitleCode
1 1 1
2 1 2
3 2 3
4 2 4
Table2:
Title Code Title EmployeeTypeCode
1 Supervisor 1
2 Manager 1
3 Assembler 1 2
4 Assembler 2 2
I have the Combo tied to table 2 for the members and the datafield to TitleCode from table1
When editing a row where EmployeeType = 1 I only want to be able to select items from table 2 where EmployeeTypeCode = 1 etc.
Does this make more sense?
0
Accepted
Hello Eric,
I believe I have solved your problem. Basically, you set the whole table as data source to the look up column.
Then, in the EditorRequired event of RadGridView, you create a new editor and set its data source to a subset of the table. Please see the attached project for details.
I hope this helps address the issue. If you need any further assistance, please contact me.
Regards,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I believe I have solved your problem. Basically, you set the whole table as data source to the look up column.
Then, in the EditorRequired event of RadGridView, you create a new editor and set its data source to a subset of the table. Please see the attached project for details.
I hope this helps address the issue. If you need any further assistance, please contact me.
Regards,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Software
Top achievements
Rank 1
answered on 31 Mar 2008, 10:33 PM
Works as expected.
It seems like the documentation is pretty sparse on these controls...?
It seems like the documentation is pretty sparse on these controls...?
0
Hello Eric,
Indeed the RadGridView documentation remained unaffected by the mass update of the help files that we did for Q3 2007. The good news is that we are doing a total overhaul of the grid help now and you will see the result in Q1 2008 release.
Sorry for the inconvenience caused. I hope the new help will suit your needs much better.
Regards,
Nikolay Dobrev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Indeed the RadGridView documentation remained unaffected by the mass update of the help files that we did for Q3 2007. The good news is that we are doing a total overhaul of the grid help now and you will see the result in Q1 2008 release.
Sorry for the inconvenience caused. I hope the new help will suit your needs much better.
Regards,
Nikolay Dobrev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Software
Top achievements
Rank 1
answered on 01 Apr 2008, 11:26 AM
Sounds good.
Thanks for the ... help.
Eric
Thanks for the ... help.
Eric
0

Daniel
Top achievements
Rank 1
answered on 21 Apr 2008, 02:41 PM
I'm trying to run this code using Q1 2008 controls, but RadComboBoxEditor no longer has HostedControl property and RadGridView1.MasterGridViewTemplate.CurrentColumn doesn't have UniqueName property. I was able to get UniqueName by casting CurrentColumn to GridViewDataColumn, but I don't know how to deal with the first problem.
Daniel
Daniel
0
Hello Daniel,
Thank you for writing.
The HostedControl property you are looking for has now been moved further down the element tree. You can access it in the following way, where radComboBoxElement1 is an instance of RadComboBoxEditor:
As far as the UniqueName property is concerned, you are correct, you have to cast the current column to an instance of the GridViewDataColumn class.
If you have any additional questions, please contact us.
Best wishes,
Kiril
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thank you for writing.
The HostedControl property you are looking for has now been moved further down the element tree. You can access it in the following way, where radComboBoxElement1 is an instance of RadComboBoxEditor:
Control
rhi = ((RadTextBoxItem)radComboBoxElement1.Children[2].Children[0].Children[0]).HostedControl;
As far as the UniqueName property is concerned, you are correct, you have to cast the current column to an instance of the GridViewDataColumn class.
If you have any additional questions, please contact us.
Best wishes,
Kiril
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Daniel
Top achievements
Rank 1
answered on 21 Apr 2008, 04:11 PM
Thanks Kiril, I'm still trying to make that example work with Q1 2008. Would you be so nice and post updated version? I'd help a lot. Thx
Daniel
Daniel
0
Hi Daniel,
All of the examples in the Examples application work with the new controls as they are. We will be providing source code for the VB examples in the coming days.
Could you be more specific, the code for which example would you like to see?
Greetings,
Kiril
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
All of the examples in the Examples application work with the new controls as they are. We will be providing source code for the VB examples in the coming days.
Could you be more specific, the code for which example would you like to see?
Greetings,
Kiril
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Daniel
Top achievements
Rank 1
answered on 21 Apr 2008, 04:51 PM
The one posted in this topic.
0
Hello Daniel,
You can find attached the same project modified to work with the 2008 Q1 RadGridView. If you compare the new version to the old one you'll see that the new one is even simpler, as there is no need to create a new editor and set it up.
Contact me again with any other questions you have.
Kind regards,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can find attached the same project modified to work with the 2008 Q1 RadGridView. If you compare the new version to the old one you'll see that the new one is even simpler, as there is no need to create a new editor and set it up.
Contact me again with any other questions you have.
Kind regards,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Daniel
Top achievements
Rank 1
answered on 22 Apr 2008, 04:23 PM
Thanks you Jordan. The reason I wasn't able to update old code for new version of controls is quite brief documentation, which is very generic in most cases. You complement it by being very helpful and responsive though. Thanks again.
Daniel
Daniel
0

devoas
Top achievements
Rank 1
answered on 20 Mar 2010, 01:29 PM
Dear Jordan,
I am testing the sample you have provided on Q1 2010. But I cannot run this due to following reasons.
1. e.Editor is always null which received from
2. (e.Editor as RadCombobox).Datasource is not working as e.Editor is always null.
Kindly provide some workaround to run the Dynamic combo binding on Q1 2010. I will be really thankful if you can provide complete sample for Q1 2010.
Thanks,
Devoas
0

devoas
Top achievements
Rank 1
answered on 20 Mar 2010, 01:41 PM
Dear Jordan,
I am testing the sample you have provided on Q1 2010. But I cannot run this due to following reasons.
1 (e.Editor as RadComboboxEditor).Datasource is not available. Seems Its been changed
2.Gridview.EditorManager.CachedManager is not more available.
Kindly provide work around or working Sample of the same Kind of Dynamic Binding .
Thanks
Devoas,
Kindly provide some workaround to run the Dynamic combo binding on Q1 2010. I will be really thankful if you can provide complete sample for Q1 2010.
Thanks,
Devoas
0

devoas
Top achievements
Rank 1
answered on 20 Mar 2010, 01:48 PM
Dear Jordan,
I am testing the sample you have provided on Q1 2010. But I cannot run this due to following reasons.
1 (e.Editor as RadComboboxEditor).Datasource is not available. Seems Its been changed
2.Gridview.EditorManager.CachedManager is not more available.
Kindly provide work around or working Sample of the same Kind of Dynamic Binding .
Thanks
Devoas,
Kindly provide some workaround to run the Dynamic combo binding on Q1 2010. I will be really thankful if you can provide complete sample for Q1 2010.
Thanks,
Devoas
0

devoas
Top achievements
Rank 1
answered on 22 Mar 2010, 03:12 PM
hello,
I found that if code is written in CellEditorInitialized then it is working properly instead of EditorRequired for Changing the data source.
That means EditorRequired should only be used for Changing the EditorType.
Please confirm.
Thanks,
devoas.
0
Hello devoas,
I am glad to hear that you have found a solution. Yes, you are correct in your assumptions. The EditorRequired event should only be used when you want to replace the default editor with a custom one. You can find more details about editors' events in our online documentation: Events, Using Custom Editors.
Regards,
Jack
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.
Regards,
Jack
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.