473,403 Members | 2,071 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,403 software developers and data experts.

Changing Datasource for Datagrid

Hi Ng,

I've got the following Problem:
There is a windows form with one Datagrid. I set the datasource at runtime
either to a at runtime designed datatable with for Columns, or to a also at
runtime designed datatable with 3 columns.

It works fine, at the first try. But when I change the datasource from 3
columns datatable to 4 columns datatable only one column (the first) appears
in the datagrid. I get the same result when i do it from 4 to 3 columns.

Any Ideas?

Thanks in Advance!

Nov 21 '05 #1
2 3763
Try setting your datagris to nothing before binding to the new dataset.

DataGrid1.DataSource = Nothing

B

"Georg Schmelzer" wrote:
Hi Ng,

I've got the following Problem:
There is a windows form with one Datagrid. I set the datasource at runtime
either to a at runtime designed datatable with for Columns, or to a also at
runtime designed datatable with 3 columns.

It works fine, at the first try. But when I change the datasource from 3
columns datatable to 4 columns datatable only one column (the first) appears
in the datagrid. I get the same result when i do it from 4 to 3 columns.

Any Ideas?

Thanks in Advance!

Nov 21 '05 #2
Thanks, but I tried that one already, doesn't work. Any other ideas?
"BrianDH" <Br*****@discussions.microsoft.com> schrieb im Newsbeitrag
news:71**********************************@microsof t.com...
Try setting your datagris to nothing before binding to the new dataset.

DataGrid1.DataSource = Nothing

B

"Georg Schmelzer" wrote:
Hi Ng,

I've got the following Problem:
There is a windows form with one Datagrid. I set the datasource at runtime either to a at runtime designed datatable with for Columns, or to a also at runtime designed datatable with 3 columns.

It works fine, at the first try. But when I change the datasource from 3
columns datatable to 4 columns datatable only one column (the first) appears in the datagrid. I get the same result when i do it from 4 to 3 columns.

Any Ideas?

Thanks in Advance!

Nov 21 '05 #3

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

Similar topics

13
by: DraguVaso | last post by:
Hi, I need a function that gives me the number of Columns shown in a DataGrid. So I don't need to know the number of columns shown in tha DataSource, because this number can be completely...
2
by: Gidi | last post by:
hello, i'm writing a windows application in C#. i have a dataGrid that takes data from dataset that connected to sql stored procedure, and i have few radio buttons. i want that when ever the...
1
by: Shawn Benson | last post by:
I have a Windows form where a user enters an order number which returns a dataset that is bound to a datagrid. The problem is when a user clicks on a cell in the datagrid, then enters another...
3
by: Doug | last post by:
Hi I have the following code (not mine) that populates a datagrid with some file names. But I want to replace the datagrid with a combo box. private void OnCurrentDataCellChanged(object sender,...
4
by: dyw55a | last post by:
Donna Mar 15, 10:11 am show options Newsgroups: microsoft.public.dotnet.framework.adonet From: "Donna" <dyw...@yahoo.com> - Find messages by this author Date: 15 Mar 2005 10:11:56 -0800...
0
by: Luis Esteban Valencia | last post by:
Hello. I have a datagrid with one row. I have a button that adds a new row. I am trying to implement that when the user selects one product it must change the price on the quantity column. Anyway...
2
by: david | last post by:
Problem: There is a search button, Search, in form, for searching patient info list. The error occurs after the following steps: 1. search first time is OK, and all found the records are...
3
by: Aziz | last post by:
1. I have a shopping basket DataGrid with a list of products. What I want to do is when the user clicks on a row, a button will become visible/be created that allows user to edit the quantity. The...
1
by: Blasting Cap | last post by:
I am having trouble changing the font for a PushButton control in a datagrid button column. I have seen several posts refer to styles and simple changes to the HTML for font changes but most of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.