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

Combobox in Custom Row Layout.

7 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rocky
Top achievements
Rank 1
Rocky asked on 03 Aug 2010, 05:36 PM
Hi!

   Anyone have an idea of using combobox  in a Custom row layout? please  help me. Here is my code

<TextBlock Text="Sex"
           Grid.Column="1" Grid.Row="2"
           VerticalAlignment="Top" HorizontalAlignment="Left"
           Foreground="Black" FontWeight="Bold" Margin="0,0,0,0" />
 
//its respective editor is
 
<ComboBox Text="{Binding Sex}"
          Grid.Column="2" Grid.Row="2"
          VerticalAlignment="Top" HorizontalAlignment="Left"
          Foreground="Black" Width="70"
          Background="Transparent"
          BorderBrush="Transparent" Opacity="1" OpacityMask="White"
          IsEditable="False" Height="Auto">
          <ComboBoxItem />
          <s:String>Male</s:String>
          <s:String>Female</s:String>              
      </ComboBox>
 
 
//Binding of the column.
<Controls:GridViewDataColumn  Header="Sex"  DataMemberBinding="{Binding Sex}" />

Problem with me is I am not able to display the string that is present in the database initially or when program loads. I am able to change the sex and save it to the database but at first the combobx is blank when it should be displaying the string value in the database.

Greetings

7 Answers, 1 is accepted

Sort by
0
Rocky
Top achievements
Rank 1
answered on 05 Aug 2010, 07:22 AM
hello,

       I have some queries .Does the normal combobox in the framework work with the radgrid view? and its custom row layout??

Ask me if you have still not understood my question. Here is a link to  my sample application showing my problem, please view the project if you are interested and have an ideo on this. My problem was the 2 values "male" and 'female' were not selected according to its respective database value instead the combobox was empty.
http://www.quickfilepost.com/download.do?get=18d661dbd36ba8d7d8c32e2e0fae3ba5
0
Vlad
Telerik team
answered on 06 Aug 2010, 12:55 PM
Hi,

 You have such problems due to invalid syntax used for binding:
...

SelectedItem="Binding Sex"
                                  SelectedValue="Binding Sex"
                                  SelectedValuePath="Binding Sex"
...

Greetings,
Vlad
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
0
Rocky
Top achievements
Rank 1
answered on 06 Aug 2010, 02:36 PM
Hello sir,

     I tried with the following syntax also which also didn't display the selected value plus it gave stack overflow exception if I select the combobox item which was working fine earlier.

SelectedItem="{Binding Sex}"
                                  SelectedValue="{Binding Sex}"
                                  SelectedValuePath="{Binding Sex}"

Sir, If you have gone through my project, please help me which type of combobox item should I use. I used that type of combobox item because I saw the similar example in the datagrid sample in website of another vendor. I couldn't find example of combobox used in custom row layout. So please help me in this project since I am stuck in the combobox only which would not take more than 5min( I guess) for You guys.
0
Rocky
Top achievements
Rank 1
answered on 10 Aug 2010, 05:42 PM
Hi Vlad;

   Is there any example or sample where different cell editors like combobox, datePicker, radio buttons etc being used in the Custom row layout ? I have Tried myself and searched for the examples for a week or so till now with little desired result. The example in the Demo Pack used only the textbox and I have also used it too, but my main Problem is with combobx. Showing that I have attached a picture with 2 screen shot side by side. In left side of the screen consist of combobox with blank value but rather it should look like the right side of the picture with its respective database value.

  If your policy allows please look into my project that I have linked above. Using my project should not be any problem since I have used  only the Telerik's controls in there. If not if there is similar example projects prepared by you guys where combobox is used in custom row layout or card view layout of Telerik's datagrid would be very helpful

hope to see your reply

Greetings
Rocky
0
Yavor Georgiev
Telerik team
answered on 13 Aug 2010, 04:31 PM
Hello Rocky,

 You only need to set the SelectedValue property of the ComboBox in your case:

<ComboBox  SelectedValue="{Binding Sex}"
       Grid.Column="2" Grid.Row="2" Width="70"
       VerticalAlignment="Top" HorizontalAlignment="Left"
       Foreground="Red"  Margin="0,15,15,0" Background="Transparent"
       BorderBrush="Transparent" Opacity="1" OpacityMask="White" IsEditable="False">
    <ComboBoxItem />
    <s:String>Male</s:String>
    <s:String>Female</s:String>
</ComboBox>

Greetings,
Yavor Georgiev
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
0
Rocky
Top achievements
Rank 1
answered on 16 Aug 2010, 02:14 PM
Hi Yavor,

     Firstly I would like to appreciate the Telerik's support to Trial users. Now Are you sure you have tried to the code you have provided on the sample application? because I had tried the same earlier also. I have also Tried Copy pasting your piece of code into my project also but still I am not able to solve this problem. :'(.......It would really help if you try the sample application above or have an example where Combobx is used in the custom row layout.

Regards,
Rocky
0
Yavor Georgiev
Telerik team
answered on 16 Aug 2010, 02:38 PM
Hi Rocky,

 Please check out the attached sample application.

Best wishes,
Yavor Georgiev
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
GridView
Asked by
Rocky
Top achievements
Rank 1
Answers by
Rocky
Top achievements
Rank 1
Vlad
Telerik team
Yavor Georgiev
Telerik team
Share this question
or