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

How to retain the selectedvalue from the RadGridViewComboBoxColumn

9 Answers 239 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hirak
Top achievements
Rank 1
hirak asked on 08 Mar 2011, 01:19 PM
Hi,

Can any one help me how to retain the value which I can select the from the RadGridViewComboBox column.

As, in my application when I select a value from the dropdown and move to the next field, the value in the Combobox field is blank.

Any sample code which will help to resolve this solution will be highly appreciated.


Thanks & Regards,
Hirak

9 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 08 Mar 2011, 01:40 PM
Hi hirak,

Firstly, you may take a look at our online documentation and demos for a reference on the usage of the GridViewComboBoxColumn. Furthermore, you may run through this troubleshooting article in case it covers your scenario. If none of those helps, I would need a bit more details about your particular settings, the definition of the column and the declaration of your business objects - both for the grid and the column.

 

All the best,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
hirak
Top achievements
Rank 1
answered on 08 Mar 2011, 04:28 PM
Hi Maya,

My requirement is :

1) The values in the RADGridViewComboBoxColumn should retain its value after selecting from the drop down.
2) When, I select an item from the 1st drop down the value in the 2nd drop down should get changed.

Any sample code in this regard will be highly helpfull as I could not relate my requirement to any references which you have mentioned in your post.

Please send me the sample code for this case.

Thanks & Regards,
Hirak
0
Maya
Telerik team
answered on 08 Mar 2011, 04:32 PM
Hello hirak,

You may take a look at this blog post for a reference.
 

Regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
hirak
Top achievements
Rank 1
answered on 09 Mar 2011, 08:40 AM
Hi Maya,

The sample code given in the blog when I executed in my local machine it worked fine.

But, when I used the same code syntax in my application it is throwing an exception in the below mentioned line:

this.AddHandler(RadComboBox.SelectionChangedEvent, new Telerik.Windows.Controls.SelectionChangedEventHandler(comboSelectionChanged));


The exception is:
Error   15   'Telerik.Windows.Controls.SelectionChangedEventHandler' does not contain a constructor that takes 1 arguments   D:\CFUNDProj\StrategicSolutions\StrategicSolutionsPortal-VS2008-Structured-v1-CODEREVIEW_9_1_2010\PresentationTier\Windows\SSG_Trade_Express\UserControls\ContributionAndWithdrawal.xaml.cs   103   64   SSG_Trade_Express

Please, suggest me a quick solution to the above problem.

Looking forward to your early reply.

Thanks & Regards,
Hirak
0
Maya
Telerik team
answered on 09 Mar 2011, 09:47 AM
Hi hirak,

As you are working with WPF RadGridView, you have to use the System.Windows.Controls.SelectionChangedEventHanlder. I am sending you the sample project but targeting WPF platform. Please take a look at it and let me know if you need further assistance.

 

Kind regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
hirak
Top achievements
Rank 1
answered on 09 Mar 2011, 10:01 AM
Hi Maya,

I have declared the same namespace and checked the dll versions for Telerik.Windows control both are same.

But still it throws the same exception as mentioned below:
Error   16   The type or namespace name 'SelectionChangedEventHandler' does not exist in the namespace 'Telerik.Windows.Controls' (are you missing an assembly reference?)  



Is there any work around to this issue.

Looking forward to your early reply.

Thanks & Regards,
Hirak
0
Maya
Telerik team
answered on 09 Mar 2011, 10:06 AM
Hi hirak,

Please try the suggestion above - to use the System.Windows.Controls.SelectionChangedEventHanlder as there is slight difference between Silverlight and WPF. 
 - Silverlight - Telerik. Windows.Controls.SelectionChangedEventHandler;
 - WPF - System.Windows.Controls.SelectionChangedEventHanlder

 

Regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
hirak
Top achievements
Rank 1
answered on 11 Mar 2011, 11:24 AM
Hi Maya,

Finally I was able to retain the value in the GridViewComboBox column.

But, now I have one more problem when I move out of the row the entire data goes off.

My requirement is after adding all the dropdown values, I will have to save the records entered in that row in the database and display it in the RadGridView control.

How do I achieve this.

Please, suggest me with some simple sample code for reference as quickly as possible.

Thanks & Regards,
Hirak
0
Maya
Telerik team
answered on 11 Mar 2011, 01:19 PM
Hello hirak,

May you provide a bit more details about the exact behavior you experience and the one you want to get ? Do the values inside the GridViewComboBoxColumn disappear on losing focus similar to the scenario in this article ? Or you want to be able to add new items to the source of the column like it is demonstrated in the attached sample project ? 
 

Best wishes,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
hirak
Top achievements
Rank 1
Answers by
Maya
Telerik team
hirak
Top achievements
Rank 1
Share this question
or