datagrid

Populating grid in C# 3.5

Yesterday i installed C# 3.5 and today when read topic here of "Accessing Google Spreadsheets with C# using Google Data API", and decided to try it out. So i decided to write a example, that: 1) get data feed of first Worksheet of first Spreadsheet, that name contains string segment that user inserted 2) fill grid with data Well i got...

Need to format dates in dynamically built WPF DataGrid.

We are binding an unknown result set to a WPF DataGrid at run time. Some of our columns are going to contain DateTime values and we need to properly format these date time fields. Without knowing which columns are going to be DateTime fields at design time, how are we able to format the columns at runtime? We are using a DataTable's D...

Retrieve row order from DataGrid 1.0

I am working a legacy app which is .net 1.1 and I need to retrieve the rows in a datagrid post sort (by clicking on column header). This sounded like an easy task however, the answer seems to elude me. I can retrieve the rows from the dataset just fine but, they are not sorted again when the header is clicked. I appreciate any input. ...

How to code a button to get data from a table in database and display in datagrid view ?

I'm trying to code a button which has a SELECT statement to get information from one table but I want the information displayed in a data grid view. From the data grid view, this data will be stored in a different table within the same database. Previously i had used a list box to display the information but i could not save it in the ...

How can I access DataGridRow from a textbox on that row?

In a DataGrid, when text in a textbox changes I want to add the value of another field in that row to an array. public void txtTitle_TextChanged(object sender, EventArgs e) { TextBox titleBox = (TextBox)sender; DataGridItem myItem = (DataGridItem)titleBox.Parent.Parent; string test = DataBinder.Eval(myItem.DataItem, "prod_id...

WPF Toolkit Datagrid - Custom Tabbing

I have a WPF Toolkit Datagrid with 3 columns. Only the third column allows data entry - the first two are static (Text descriptions). Is it possible to control tabbing and navigation such that the tab and up-down-left-right buttons will ignore the first two columns and operate within the confines of the third? Thank you Jason ...

Export to Excel Formatting

I have set up a basic html table with a reader in each cell (don't ask) that exports to excel, I also have a datagrid that exports to excel. Both work without issue in regards to actually creating the spreadsheet, but I have a question regarding formatting. Inside each cell is a list of names, i.e.: Bob Smith Jim Bob John Miller ...

Responding to ItemClick events in rows, not the headers

I have a functional datagrid that responds to itemClick events. Everything works, except that it also triggers the itemClick event when the headers are clicked. So instead of sorting the grid data they trigger the event which changes the state. I want to only have the click event respond to the rows being clicked, not the headers. ...

Text Wrapping when printing DataGrid? .Net

I'm trying to print a DataGrid in a windows forms app and when the width of the columns is set (it's customizable) too narrow to fit the text it just truncates the text instead of wrapping it. Is there a property in DataGrid that sets text wrapping? I've added some code to perhaps help with diagnosis of the issue. private void PrintRow...

ASP.NET DataGrid and HoverMenu Extender

I have an ASP.NET DataGrid that I am trying to add a HoverMenu Extender to. The grid markup is as follows: <asp:datagrid id="dgrExisting" runat="server" autogeneratecolumns="false" cssclass="FormattedTable" onitemcommand="dgrExisting_ItemCommand" onitemdatabound="dgrExisting_ItemDataBound"> <headerstyle cssclass="Format...

flex datagrid - making grid height dynamic and component that contains it

HI, i want to build a datagrid which will have a dynamic height value because the number of rows will always be different. I also want to communicate the height back to the component holiding it so that it also grows with the datagrid. Can anyone help me out on the best way to create such a dynamic datagrid. Thanks ...

How can I bind Wpf DataGridColumn to an object?

I want to bind the columns of my WPF DataGrid to some objects in a Dictionary like this: Binding Path=Objects[i] where Objects is my Dictionary of objects, so that each cell will represent an Object element. How can I do that? I suppose that I need to create a template for my cell, which I did, but how to get the result of column bin...

Increase columns width in Silverlight DataGrid to fill whole DG width

Hello, I have a DataGrid Control which is bound to a SQL Table. The XAML Code is: <data:DataGrid x:Name="dg_sql_data" Grid.Row="1" Visibility="Collapsed" Height="auto" Margin="0,5,5,5" AutoGenerateColumns="false" ...

Cannot access arrayCollection's children in datagrid

Hi Guys, I've got a Flex 3 application with an HTTPService returning an Atom feed. I catch the result from it and store it in an arrayCollection which is then the provider of my Datagrid. I have no problem accessing the data from the "first-level" of my Array, but cannot go under it. Not very clear, so here is some code: My XML [part o...

Update DataGrid WinForm control in .Net 2003

I've been using VS 2005 and VS 2008, and never asked this question, but now I'm having a hard time using controls in VS 2003. A dataGridView does not exist, and I'm forced to use DataGrid control to show some data. The problem is, that I want to edit some of the values displayed by this control, and to reflect those changes in database, ...

PopUpWindow and null object reference

Hello, I've been struggling with this problem for last few hours but still got no idea what's wrong. Here's the scenario: Application built on top of the Mate framework sometimes need to exchange data with remote server over plain binary socket. When specific packet is received I have to switch view (using ViewStack) and create custo...

flex datagrid freezes while retrieving data

hi, i have a datagrid which grows in size depending on the result of a call to my db. The call to the database returns an object with 30+ values for each row. When the number of rows returned exceeds about 80-90 the datagrid renders odd. It displays the first 50-60 rows fine but then it displays blank rows and they even continue to disp...

What are the best practices for using AJAX with DataGrids?

I have a Data Grid and an Update Panel. Now, I was just looking over some blogs and found that you should use the least amount of Update Panels as you can. In my case, where I have a Datagrid and an Update Panel, which would be the best situation? 1) Keep the Datagrid inside the Update Panel. 2) Use an Update Panel inside ItemTemplates...

How can I set the binding of a DataGridTextColumn in code?

I'm using the toolkit:DataGrid from CodePlex. I'm generating the columns in code. How can I set the equivalent of {Binding FirstName} in code? Or alternatively, how can I just set the value, that's all I need to do, not necessarily bind it. I just want the value from my model property in the cell in the datagrid. DataGridTextColumn d...

How to I respond to changed cells in the CodePlex WPF DataGrid?

In my view, I've implemented a the WPF DataGrid from CodePlex: <toolkit:DataGrid x:Name="CodePlexDataGrid" Style="{StaticResource ToolkitDataGrid}" ItemsSource="{Binding Customers}"/> It is bound to an ObservableCollection in my ViewModel: private ObservableCollection<Customer> _customers; public ObservableCollection<Custom...