473,413 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Datagrid problems

why i have no datas in my datagrid but i have 16 rows but no columns.
16 rows that is the correct rows for all my datas but i dont see thes datas
in my datagrid.

someone a idea?

Thanks Jens

// Set up the DataAdapter and fill the DataSet

da.SelectCommand = cmdSelect;
da.UpdateCommand = cmdUpdate;
da.DeleteCommand = cmdDelete;

dataGridTableStylePeriode.GridColumnStyles.Add(dat aGridTextBoxColumnID);
dataGridTableStylePeriode.GridColumnStyles.Add(dat aGridTextBoxColumnName);
// etc...

dataGridClient.TableStyles.Add(dataGridTableStyleC lient);
da.Fill(ds, "tblClient");

dataGridClient.SetDataBinding(ds, "tblClient");

Nov 15 '05 #1
2 1087
Jens,
Perhaps you could try this:
// Set up the DataAdapter and fill the DataSet

da.SelectCommand = cmdSelect;
da.UpdateCommand = cmdUpdate;
da.DeleteCommand = cmdDelete;

DataGridTextBoxColumn dataGridTextBoxColumnID= new DataGridTextBoxColumn();

dataGridTextBoxColumnID.MappingName = "ID"; //ID is supposed to be the
field name from "tblClient" table

dataGridTextBoxColumnID.HeaderText = "ID"; //This is the header text

dataGridTextBoxColumnID.Width = 80;
dataGridTableStylePeriode.GridColumnStyles.Add(dat aGridTextBoxColumnID);
Do the same as the above for field "Name"... dataGridTableStylePeriode.GridColumnStyles.Add(dat aGridTextBoxColumnName);
// etc...

dataGridClient.TableStyles.Add(dataGridTableStyleC lient);
da.Fill(ds, "tblClient");

dataGridClient.SetDataBinding(ds, "tblClient");


Hopefully would be helpful,
pcPirate
Nov 15 '05 #2
Jens,
Perhaps you could try this:
// Set up the DataAdapter and fill the DataSet

da.SelectCommand = cmdSelect;
da.UpdateCommand = cmdUpdate;
da.DeleteCommand = cmdDelete;

DataGridTextBoxColumn dataGridTextBoxColumnID= new DataGridTextBoxColumn();

dataGridTextBoxColumnID.MappingName = "ID"; //ID is supposed to be the
field name from "tblClient" table

dataGridTextBoxColumnID.HeaderText = "ID"; //This is the header text

dataGridTextBoxColumnID.Width = 80;
dataGridTableStylePeriode.GridColumnStyles.Add(dat aGridTextBoxColumnID);
Do the same as the above for field "Name"... dataGridTableStylePeriode.GridColumnStyles.Add(dat aGridTextBoxColumnName);
// etc...

dataGridClient.TableStyles.Add(dataGridTableStyleC lient);
da.Fill(ds, "tblClient");

dataGridClient.SetDataBinding(ds, "tblClient");

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lina | last post by:
Hi, Can anyone tell me if it is possible to add link buttons to a datagrid that has its source set to a datatable that i have created? i.e i want the user to be able to select a room from...
2
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you...
3
by: Igor Mendizabal | last post by:
Hello, We're doing our own datagrid based on the System.windows.forms.datagrid control, and are having some problems with horizontal scrolling. In general, we construct our datagrid adding a...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
0
by: THM5101 | last post by:
Hello I have two problems with my dataGrid. I created dataGrid with 4 columns. The first and the last one are LinkButton type, the second and third are Bound Column type. My problems are:...
5
by: sdbranum | last post by:
I have been using Visual C#.NET to code a large project having many data adapters, data sets, datagrids, multiple forms with tab pages, each containing various controls (mostly label, text boxes,...
0
by: Linus | last post by:
Hi, I have a datagrid nested inside another datagrid, the edit/update/cancel command works fine on the outter datagrid but I'm having problems with the inner one. There are 2 problems and here's...
3
by: nkunkov | last post by:
Hi, I have read a lot of articles in this newsgroup about how to solve this problem but found no solution. I'm trying to export a C# datagrid to Excel file. Here is my code that I have also...
3
by: simchajoy2000 | last post by:
Hi, I have been working with datagrids a lot in the past two weeks and I am running across a lot of problems. Maybe there is no way around these problems but I hope there are and someone out...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.