I am binding a data grid to a collection of Task objects. A particular column needs some special rules pertaining to editing:
<!--Percent Complete-->
<data:DataGridTextColumn Header="%"
ElementStyle="{StaticResource RightAlignStyle}"
Binding="{Binding PercentComplete, Mode=TwoWay, Conv...
I declared a DataGrid in a ASP.NET View and I'd like to generate some C# code to populate said DataGrid with an Excel spreadsheet (.xlsx). Here's the code I have:
<asp:DataGrid id="DataGrid1" runat="server"/>
<script language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e)
{
...
Hi,
I have a datagrid and one of the columns is going to be a checkbox column. To give the background, the checkbox is going to turn something on / off and each row in the datagrid is going to be for a differernt time (in time order, ascending).
Is it possible for one row's checkbox to be bound to the state of the previous row? That wa...
Essentially what I want to do is to apply additional CSS classes to individual cells in a data grid based on the value of the cell. An example would be to color the text red when a dollar value is negative.
The only solution I've found was to use the formatter of the column to create a string for a span that has the class based on the ...
I have a custom dataGrid that acts more like a 2D list (if that makes sense at all). I am dynamically creating the columns and recreating the dataProvider to suit my needs. While debugging I can see that I am creating the columns and setting them to the dataGrid and creating and setting the dataProvider, but for some reason I am able t...
I create DataGrid Columns with Binding (where i is a Int value):
dataGrid.Columns.Add(new DataGridTextColumn
{
Header = i.ToString(),
Binding = CreateBinding(i),
});
private Binding CreateBinding(int num)
{
Binding bind = new Binding(string.Format("[{0}]", num));
bind.Converter = new CellValueConverter();
retu...
I want to add a ComboBox to a DataGrid. So far, the only way I've found to do it is like this:
<mx:DataGridColumn headerText="Header" dataField="src" >
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox dataProvider="{data.srcChoices}" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
T...
Hi,
I need to use a two dimensional grid with headers in the left and the top on Silverlight.
Is it possible to configure a grid for that or I need to use an other control ?
Best regards.
Narglix
...
i binding datasource in my datagrid when i remove some rows in datagrid my database not update
how?
...
I have a DataGrid style in App.xaml:
<Style TargetType="{x:Type DataGrid}">
<Setter Property="Foreground" Value="{StaticResource DataGridItemTextBrush}" />
<Setter Property="VerticalGridLinesBrush" Value="{StaticResource GridBrush}" />
<Setter Property="HorizontalGridLinesBrush" Value="{StaticResource GridBrush}" />
<Set...
how to create a progress column in DataGrid control
...
Hi,
I'm trying to write an application that has two DataGrids - the first one displays customers and the second one selected customer's records. I have generated the ADO.NET Entity Model and the connection property are set in App.config file. Now I want to populate the datagrids with the data from sql ce 3.5 database which does not suppo...
Lets say I have 2 columns in my data Grid: Column A: Selected, and Column B: Name. The Selected column is a checkbox. And Name column is text field. I want to set the color of the text in 'Name' column as Blue if Column A's check box is checked, and Red otherwise.
Essentially I don't know how to bind data between columns of the datagrid...
I have a DataGrid and I set the DataProvider to my data. When my data changes the DataGrid loses the selected row and the scroll bar jumps back to the top. How do I maintain the selection and scroll position?
...
Hello,
I have a datagrid with some TextColumn and one DataGridCheckBoxColumn. I bind it with à itemsource that contaned à boolean and i can see that my checkboxes or checked or not by the boolean everything is OK at this point.
but the checkboxs cells are in ReadOnly even if i assigne IsReadOnly = False. I cant find the right and clean...
I need to allow users on mouse click in DataGrid to edit whole row?
Right now users must double click on cell to enter it in edit mode and I want to make all cells of a selected row to be in edit mode. I need to do this in code.
I was trying to call BeginEdit on Grid's MouseLeftButtonUp but it didn't work.
...
I have a pretty simple operation but am struggling with how to implement it.
I am loading XML from an external data source using a DataSet.ReadXml(), then creating a new XMLDataDocument from that data set, then syncing the Dataset with updated data from the XMLDataDocument like so:
doc = new XmlDataDocument(dsDataSet);
dsDataSet.Enforc...
Hi,
I am trying to get the name of the property associated with a particular DataGridColumn, so that I can then do some stuff based on that. This function is called when the user clicks context menu item on the column's header...
This is fine for the out-of-the-box ready-rolled column types like DataGridTextColumn, since they are boun...
I have a datagrid that is multi-select enabled. I need to change the selection in the viewmodel. However, the SelectedItems property is read only and can't be directly bound to a property in the viewmodel. So how do I signal to the view that the selection has changed?
...
I've been banging my head against the wall for a couple of days on this and it's time to ask for help.
I've got a DataGrid and DataForm on the same UserControl. I'm using an MVVM approach so there is a single ViewModel for the UserControl. That ViewModel has a couple of properties that are relevant to this discussion:
public Observable...