datagrid

Silverlight DataGrid set cell IsReadOnly programatically

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...

Excel Reader ASP.NET

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) { ...

WPF datagrid bind to previous row's cell

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...

How do you conditionally style a cell in a Dojo data grid?

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 ...

Flex DataGrid not Displaying Data

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...

WPF: How to get Binding.Converter

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...

How do I add a combo box to a DataGrid?

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...

2 dimensionnal grid component of Silverlight ?

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 ...

How to update my database when datagrid delete some rows ?

i binding datasource in my datagrid when i remove some rows in datagrid my database not update how? ...

WPF: Why does ItemsPresenter override my DataGrid's foreground style?

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...

Progressbar control in Datagrid in c#

how to create a progress column in DataGrid control ...

WPF: How to connect to a sql ce 3.5 database with ADO.NET?

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...

WPF DataGrid bind data between columns

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...

How do I maintain selection in a DataGrid when the data changes?

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? ...

How to edit boolean in a DataGridCheckBoxColumn in Silverlight 3

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...

SL How to enable edit mode for whole row in GridView?

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. ...

How do I update a .NET DataSet via XMLDataDocument for application to a DataGrid control?

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...

WPF - How to bind a DataGridTemplateColumn

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...

WPF DataGrid multiselect binding

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? ...

Synchronize DataGrid and DataForm in Silverlight 3

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...