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

binding controls to the Gridview columns

3 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Prash
Top achievements
Rank 1
Prash asked on 05 Feb 2009, 08:19 AM
Hello,
 I want to bind textboxes and comboboxes to the columns of the Grid, In the textbox i want to validate the ip addresses, 
Is it possible to achieve?
A sample code would be helpful.

Thanks in advance 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Feb 2009, 07:57 AM
Hello Prash,

Please check the demos in your other post:
http://www.telerik.com/community/forums/wpf/gridview/wpf-radgrid-help.aspx

As I said in my previous reply currently we do not have any masked editor (to validate IP address for example) however this control will be part of our Q1 2009 release (early March).

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Prash
Top achievements
Rank 1
answered on 09 Feb 2009, 10:30 AM
Hello,

I want to Bind a combobox in the grid template, and in turn the Combox will have the Hashtable as the source,
Is it possible to achieve this?
I have tried the above mentioned scenario, and the comboxbox gets populated but the items in the Combox shows System.Collections.DictionaryEntry.

What should be the appropriate solution for this, can you explain it with code.



Thanks and regards
0
Hristo Deshev
Telerik team
answered on 11 Feb 2009, 10:24 AM
Hi Prash,

You need to configure the ComboBox to use DisplayMemberPath and SelectedValuePath settings for your Key and Value properties (the ones getting data from the DictionaryEntry object):

<Grid> 
    <Grid.RowDefinitions> 
        <RowDefinition Height="22"></RowDefinition> 
        <RowDefinition Height="50"></RowDefinition> 
    </Grid.RowDefinitions> 
    <ComboBox Name="combo1"  
              ItemsSource="{Binding}"  
              Grid.Row="0" 
              Width="150" 
              HorizontalAlignment="Left" 
              SelectedValuePath="Value"  
              DisplayMemberPath="Key"
    </ComboBox> 
    <HeaderedContentControl  
        Grid.Row="1" 
        HorizontalAlignment="Left" 
        Header="Selected value"  
        Content="{Binding ElementName=combo1, Path=SelectedValue}"
    </HeaderedContentControl> 
</Grid> 

I am attaching a sample project.

Kind regards,
Hristo Deshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Prash
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Prash
Top achievements
Rank 1
Hristo Deshev
Telerik team
Share this question
or