Hi there,
I've googled, searched this forum and read the docs and from what I can see there is no way in an editable grid for the user to add a new row (or delete an existing one) natively, is this correct?
For example, in my app I have the data grid below which the user enters an auction Lot # and a value of the lot. When the page is rendered the datagrid should be empty but the user would add new rows to enter lots they have bidded on and won, or delete a row if they need to.
I hope I'm wrong but I cannot see a single thing about adding or deleting rows natively so can we only do this by having explicit buttons outside the grid control for adding/deleting and do it all with code behind and/or RelayCommands in the ViewModel?
Or am I using the wrong control? It's such a simple grid (just the two columns with no filtering, grouping etc) is there a better control I could use?
And sorry to ask two questions in one but when I try to style the column headers or cell content style with a custom colour using DynamicResource I get this error:
XFC0009 No property, BindableProperty, or event found for "BackgroundColor", or mismatching type between value and property.
Is it not possible to use custom styling like this?
Many thanks,
Mike
<ScrollView Grid.Row="7" Grid.ColumnSpan="2" VerticalOptions="Fill" HorizontalOptions="Fill" Margin="10,20,10,10">
<telerik:RadDataGrid x:Name="grdInsuredAnimals" ItemsSource="{Binding CurrentApplication.AuctionDetails.LotDetails}"
AutoGenerateColumns="False" UserEditMode="Cell" CanUserResizeColumns="True" ShowGroupHeaderAggregates="False"
UserGroupMode="Disabled" CanUserExpandMultipleRowDetails="False" CanUserReorderColumns="False" >
<telerik:RadDataGrid.Columns>
<telerik:DataGridComboBoxColumn PropertyName="LotNumber" HeaderText="Lot #" ItemDisplayBindingPath="LotNumber">
<telerik:DataGridComboBoxColumn.HeaderStyle>
<telerik:DataGridColumnHeaderStyle BackgroundColor="{DynamicResource RA_DarkBlue}" TextColor="White"/>
</telerik:DataGridComboBoxColumn.HeaderStyle>
<telerik:DataGridComboBoxColumn.CellContentStyle>
<telerik:DataGridTextCellStyle TextColor="{DynamicResource RA_Blue}"
FontSize="15" SelectedTextColor="{DynamicResource RA_Orange}"/>
</telerik:DataGridComboBoxColumn.CellContentStyle>
</telerik:DataGridComboBoxColumn>
<telerik:DataGridNumericalColumn DataMemberBinding="{Binding AnimalValue, StringFormat='{0:N0}'}" PropertyName="AnimalValue" HeaderText="Sum Insured">
<telerik:DataGridNumericalColumn.HeaderStyle>
<telerik:DataGridColumnHeaderStyle BackgroundColor="{DynamicResource RA_DarkBlue}" TextColor="White"/>
</telerik:DataGridNumericalColumn.HeaderStyle>
</telerik:DataGridNumericalColumn>
</telerik:RadDataGrid.Columns>
</telerik:RadDataGrid>
</ScrollView>