Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
703
Few questions on xamGrid
posted
i am new to infragistics silverlight grid. So i have few questions 1. I am adding a row at the end of the grid, after commiting the data of previous column. But failed. Followed the way that described in local help file. Please help me in this. 2. I am able to set the data to grid but do'nt know how to save the changed value to database. 3. I have 7 columns in my grid from Sun - Sat. These columns are defined as follows igGrid:TextColumn Key="SatHrs" HeaderText="Sat" with these columns , i have to track the usage hours and are filed of type numeric. Also i have a column called Total which will calculte the total of weeks hour usage. Similar to the Sum function of excel. say if in 1st column i have 3 and in 5th column i am having 6 then in total it will display 9 and consider blank columns as 0. if i erase 3 from 1st column then the total will display 6. Means change in a single cell will calculate the values of all remaining 6 cells and display in total's cell. I am using VB in code behind, C# is also welcome
Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    1.  I'm not sure what help topic your referring to.  Are you using the AddNewRow feature?

    2. To update your data in the backend, when you update it, you can either use the ExitEditMode event, or you can implement IEditableObject on your data, in which case, you'll know when your data object has been updated. 

    3. For this, you can use a TemplateColumn, and use an IValueConverter. 

    <UserControl.Resources> <local: DayUsageConverter x:key="MyDayUsageConverter"/></UserControl.Resources>

    <DataTemplate>
    <TextBlock Text = {Binding, Converter={StaticResource MyDayUsageConverter}/>
    </DataTemplate 

    public class DayUsageConverter: IValueConverter

    {

    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

    {

          YourDataObject data = (YourDataObject)value;

          double val = data.Monday + data.Tuesday ... etc

        return val;

    }

    }

     

    -SteveZ

Children