Welcome to the Xceed Community | Help
Community Search  

How can I put combobox in xceed grid at edit time

Sort Posts: Previous Next
  •  08-19-2008, 6:04 PM Post no. 14231

    How can I put combobox in xceed grid at edit time

    Hi, 

    I have few queries using xceed grid:

    1. How can i put combobox in xceed grid at edit time?

    2. how can i fill that combobox values with all department

    3. How can i fill my values based on the row selected from grid to my controls?
    Note : in this case,I dont want to use datacontext object.

    Please Help.

    Here is my code:

    //xaml file


    <TextBox Grid.Row="1" x:Name="txtName" TextWrapping="Wrap" Padding="1" Margin="5,5,9.423,5" />
    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="cbDepartment" Margin="5,5,9.423,5" IsSynchronizedWithCurrentItem="True"  Padding="1">
        <ComboBoxItem>IT</ComboBoxItem>
        <ComboBoxItem>Sales</ComboBoxItem>
        <ComboBoxItem>Distribution</ComboBoxItem>
    </ComboBox>
    <TextBox Grid.Row="1" x:Name="txtAge" TextWrapping="Wrap" Padding="1" Margin="5,5,9.423,5" />

    <xcdg:DataGridControl Height="250" HorizontalAlignment="Stretch" Margin="5,0,20,5" Name="dgEmployee" VerticalAlignment="Top" xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" Grid.Row="2" AutoCreateColumns="False" CellEditorDisplayConditions="RowIsBeingEdited, RowIsCurrent, CellIsCurrent">
        <xcdg:DataGridControl.Columns>
        <xcdg:Column FieldName="Name" Title="Name" IsMainColumn="True" />
        <xcdg:Column FieldName="Department" Title="Department" />
        <xcdg:Column FieldName="Age" Title="Age" />
        <xcdg:Column FieldName="LastUpdateDate" Title="Last Update Date" />
        <xcdg:Column FieldName="LastUpdateUser" Title="Last Update User" />
        <xcdg:Column FieldName="BirthDate" Title="BirthDate" />
        </xcdg:DataGridControl.Columns>
        <xcdg:DataGridControl.View>
        <xcdg:TableView UseDefaultHeadersFooters="False">
            <xcdg:TableView.FixedHeaders>
            <DataTemplate>
                <xcdg:ColumnManagerRow />
            </DataTemplate>
            </xcdg:TableView.FixedHeaders>
            <xcdg:TableView.Theme>
            <xcdg:Office2007BlueTheme />
            </xcdg:TableView.Theme>
        </xcdg:TableView>
        </xcdg:DataGridControl.View>
    </xcdg:DataGridControl>




    //Code Behind Logic

            public DFEmployee()
            {
                InitializeComponent();
            GridSource=ReadFromDataSet();
            }

            public DataView ReadFromDataSet()
            {
                dt = ds.Tables.Add("employee");
                dt.Columns.Add("Name", typeof(string));
                dt.Columns.Add("Department", typeof(string));
                dt.Columns.Add("Age", typeof(string));
                dt.Columns.Add("LastUpdateDate", typeof(string));
                dt.Columns.Add("LastUpdateUser", typeof(string));
                dt.Columns.Add("BirthDate", typeof(string));
                dt.Rows.Add("Mike", "IT", "25", "01/01/08 9:06 AM", "UserName", "08/21/1980");
                dt.Rows.Add("Chris", "Sales", "24", "01/01/08 9:06 AM", "Name", "12/21/1981");
                dt.Rows.Add("John", "Distribution", "23", "01/01/08 9:06 AM", "Name", "11/21/1982");
            dt.Rows.Add("John", "Payroll", "23", "01/01/08 9:06 AM", "Name", "11/21/1982");
                return ds.Tables["employee"].DefaultView;
            }

            public System.Data.DataView GridSource
            {
                get
                {
                    return null;
                }
                set
                {
                    this.dgEmployee.Items.Clear();
                    this.dgEmployee.ItemsSource = value;
                }
            }

    Filed under:
  •  08-20-2008, 3:14 AM Post no. 14238 in reply to 14231

    Re: How can I put combobox in xceed grid at edit time

    Hi,

    Please find relative answers here:
    http://xceed.com/CS/search/SearchResults.aspx?q=edittemplate+combobox&u=38900&o=DateDescending

    Thanks,


    Abdullah Ansari
    Senior Software Engineer
    Outworks Solutions Private Limited

    Everything is okay in the end. If its not okay, then its not the end.
    Filed under: ,
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.