datagrid

How to add checkbox control at the beginning of every row in datagrid control ?

I am developing mobile application in C#. I want to add the checkbox control dynamically at the beginning of every row in the datagrid control & based on that particular checkbox selection I want to fire the event. I want to add the checkbox column & based on the selection of any particular checkbox, I want to fire the event on that chec...

WPF Datagrid ItemsSource

I have a dynamic set of columns and when I populate the rows and know only the columnname of the rows. Is that possible to do? A list of columns: Columns[0] = "firstcol"; Columns[12] = "anothercol"; And a list of rows. First row Rows[0][0] = "item"; Rows[0][12] = "item"; Second row Rows[1][0] = "item"; Rows[1][12] = "item"; I need ...

Can I programmatically add a row to a WPF datagrid?

I just want to add a new row, I have my datasource in objects in which I need to do some processing. i need something like below for wpf datagrid... DataRow row = dataTable.NewRow(); foreach (NavItem item in record.Items) { row[item.FieldNo.ToString()] = item.RecordValue; } dataTable.Rows.Add(row); ...

Set Width of WPF DataGridCell individually for each cell?

Hello, I have a DataGrid with ONE column. The ItemsPanelTemplate of the DataGrid is in a WrapPanel so the rows are aligned horizontally. Each Cell of the "Row" has the same width, is it possible that every string in the cell takes only the space it needs so I have cells with a short/long width? ...

MVVM - WPF DataGrid - AutoGeneratingColumn Event

Hello all, I'm currently taking a good look at the excellent toolkit from Laurent and I have the following question. From Blend 4, I have added an EventTrigger for the Loaded event, in my ViewModel I have the following: public RelayCommand rcAutoGeneratingColumn { get; private set; } In the constructor I have: rcAutoGeneratingColum...

Radio button in datagrid for selecting the entire row

Hi, I have a Datagrid in Flex. I need to add a radio button in first column such that when I select that radio button, entire row should get selected. I have tried using following code - <mx:DataGridColumn id="selectColumnRadioButton" sortable="false" textAlign="center" editable="false" width="18"> <mx:itemRen...

DragAndDrop selectedItems of one silverlight Datagrid into another.

Currently I am using "DataGridDragDropTarget" to Drag a row from one datagrid to another, but a client want to be able to select multiple rows from one datagrid and drop them into another. I played around a bit but realized "DataGridDragDropTarget" seems to be able to drag and drop single row at a time only. Is there any alternative w...

Silverlight 4 DataGrid border around a column

I haven't been able to find anyway to dynamically add a border around a column in a silverlight datagrid. Here is my xaml of my datagrid: <sdk:DataGrid x:Name="PlannedAndBookedMonthlyTable" ItemsSource="{Binding}" AutoGenerateColumns="False" Margin="5,0,5,5"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn x:Name="MonthlyHeaderN...

Dojo DataGrid - Getting data store item from formatter?

Hello, From what I've seen, the formatter function in Dojo DataGrid is given the following arguments: cell value, cell row number, and the cell object itself. Can you suggest how to obtain data store item to which this cell refers, given these arguments? Or if you can suggest an alternative way, I'd be grateful. ...

WPF DataGrid: How do I databind the properties of the SelectedItem to trigger INotifyPropertyChangedEvents?

I'm trying to do this as MVVM as possible: My Model (InterestTypeEntity) implements INotifyPropertyChanged. My ViewModel (InterestTypeAllViewModel) has an ObservableCollection that binds to a DataGrid. When changes are made to it, it sends those changes (add/remove) to the Database. the problem is, I want to also be able to update the d...

Combox Box withing a Data Grid is not populated with data....

I am doing when the form loads up DataGridViewComboBoxColumn ComboTextCol = new DataGridViewComboBoxColumn(); ComboTextCol.Headertext = "some"; ComboTextCol.DataSource = GetEmployees().Select(e => new { Name = e.LastName + " ," + e.FirstName, ID = e.EmployeeID }).ToList(); ComboTextCol.ValueMember =...

How to set a State when clicking on a cell in a DataGrid

Hi, While working on my Silverlight4 SketchFlow prototype I have a datagrid that has a column of hyperlinkbuttons. I would like to set a State when one of these buttons is clicked. It doesn't appear that the controls inside the datagrid are exposed to drop a behavior on them. Is there any way to do this? Essentially, I am trying to set ...

Flex/AIR: Export DataGrid to Excel with multiple sheets

Hello, I have an AIR application with two DataGrids that I would like to export to Excel. I've found the as3xls library, but it can only handle one sheet (as per the comments). Ideally, I'd like to export both DataGrids into separate sheets in the same workbook. The AIR application is running entirely on the user's desktop and doesn't...

Datagrid, getting and setting individual cell values

Hi, I have Flex 4 DataGrid, what I would like to do is when an cell has been edited, I would then like to walk through the values of that column and preform math on the values, eg I want to total up certain values. 1) How do I reference individual values of a specific column so that I may set them. 2) How do I then set those values or ...

'DataGridView' VS 'DataGrid' when Convert to 'DataSet' ?

Hello. I bound excel data with DataGridView controller successfully. Then I try to save the DataGridView contents to xml file. I want to implement as belwo, but throw exception. How can I fix it using DataGridView? (VS2008 used) // I tried to implement using this style.But throw exception. DataSet ds = (DataSet)(dataGridView1.DataSou...

Get or Set Cell Values in a Datagrid progmatically

Hi, In Flex 4 using a pre populated data grid, how can I get or set specific values programatically, IE I wont be using selectedItems etc. How do I reference the value of a cell in row 4 colum 6 for example. Please and thank you in advance for your help. Craig ...

How set color for cell (DataGrid WPFtoolKIt)?

i need this set RED color. how to do it? DataTable dtSet = new DataTable(); string sql = @"requevst"; using (MySqlConnection connection = ConnectToDataBase.GetConnection()) { ... int count = adapter.Fill(dtSet); } double totalPrice = 0; foreach (DataRow row in dtSet.Rows) { to...

Can the F2 key be disabled in the WPF Datagrid?

In a WPF DataGrid the F2 key is used to edit current cell. The requirements in my software project says that F2 should do something else. I have added a keybinding, but it only works when keyboardfocus is not in the DataGrid. Can I disable or remove the DataGrid's keybinding to the F2 key? ...

DataGrid.ItemsSource.Refresh() not working

Hi I have a wpf form which contains a datagrid. I did put a button on my form to "Refresh" the datagrid. Steps I'm trying to get it to refresh: I update the viewsource from my db: SupportCaseViewSource.Source = SupportCaseManager.GetAllSupportCases(); I refresh the datagrid items: SupportCaseDataGrid.Items.Refresh(); But nothing ha...

Dojo Grid reload data file upon button click

I know there maybe similar questions out there, but I still cannot find the answer. Much appropriate anyone who can help me. There are 5 departments, and each department has 4 products. So I created 5 buttons and 4 tabs, each tab contains a grid. By default the department A is loaded, user can switch tabs to see different products info...