You must Sign In to post a response.
  • Category: Silverlight

    Datagrid combo box binding

    Hi,

    I am able bind the values to combo box inside datagrid from database.
    But instead horizontally they are getting binded vertically.

    I hope there would be solution for this.

    Please help me.


    Regards,
  • #753745
    Hi,

    didn't get your requirement can you please elaborate it little bit.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #753746
    HI,

    FOr example customer name value is 'Raju'

    it is binding to datagrid as :
    R
    a
    j
    u

    Actually it should bind horizontally as Raju.

    Thanks.

  • #753747
    Hi,

    Can you please post your combobox binding code as well as post the database binding result.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #753749
    Hi,

    Please find below:

    <sdk:DataGridTemplateColumn Header="Name" MinWidth="300">
    <sdk:DataGridTemplateColumn.CellEditingTemplate>
    <DataTemplate>
    <ComboBox HorizontalAlignment="Left" Name="cbName" VerticalAlignment="Top" ItemsSource="{Binding CustName, Mode=TwoWay}" Width="320" Height="25"/>
    </DataTemplate>
    </sdk:DataGridTemplateColumn.CellEditingTemplate>
    </sdk:DataGridTemplateColumn>

    code is:

    public LightArrangement()
    {
    InitializeComponent();
    LoadLightArrangeData();

    }

    private void LoadLightArrangeData()
    {
    objwebservice.getCustDataAsync();
    objwebservice.getCustDataCompleted +=new EventHandler<getLightSpecsCompletedEventArgs>(objwebservice_getLightSpecsCompleted);
    }

    private void objwebservice_getCustDataCompleted(object sender, ServiceReference1.getCustDataCompletedEventArgs e)
    {
    // dgCielingMounted.ItemsSource = null;
    dggetCust.ItemsSource = e.Result;
    }

  • #753751
    Hi,

    As per my understanding the values are displaying correctly.Just check the output which is getting form the dataset. Looks like you are getting the value in that way ie, each letter in every raw. You need to check those portion of code and needs to make modifications in that code/query.


    Regards,
    Asheej T K

  • #753752
    Hi,

    Please check that database return data.? Whether it returns in that manner or not, check it and let me know..

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #753767
    You need to use System.Windows.Controls.DataGridComboBoxColumn under Namespace System.Windows.Controls to box binding of Datagrid combo for hierarchy display.


  • Sign In to post your comments