473,769 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IBindingList and Datagrid Refresh Issue

I have a DataGrid bound to a custom collection that
implements IBindingList. The collection returns true for
AllowNew. The collections AddNew() method creates a new
object, adds it to the collection and returns the new
object.

The SupportsChangeN otification property returns true and
the appropriate ListChangedEven tArgs are used in the
ListChanged event. All fine no problem. However:

If there are items in the collection, and therefore items
in the DataGrid, when the AddNew() method of the
collection is called, all is well and the datagrid adds a
new blank row bound to the new object. Super.

If however the collection is empty, and therefore no rows
in the DataGrid, when AddNew() method of the collection is
called, the DataGrid responds by adding a new row, but
with no columns. Just a tiny bit of white on the left hand
side of the area where the columns are supposed to be.

I have tried calling Invalidate and refresh on the Grid
but this has not helped.

Any help would me most appreciated.

Many thanks

Phillip.
Jul 21 '05 #1
0 1193

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

Similar topics

0
258
by: Phillip | last post by:
I have a DataGrid bound to a custom collection that implements IBindingList. The collection returns true for AllowNew. The collections AddNew() method creates a new object, adds it to the collection and returns the new object. The SupportsChangeNotification property returns true and the appropriate ListChangedEventArgs are used in the ListChanged event. All fine no problem. However:
3
1884
by: Cary Linkfield | last post by:
I have created a custom class inheriting CollectionBase and implementing IBindingList. I am binding the list to a datagrid. I would like to have a property on the class that works like the RowState of a DataRow that can tell the datagrid not to display the item anymore after it is marked for deletion by the user. I have a property on the class that indicates whether the item is Added, Unchanged, Modified or Deleted. I would like to...
0
2376
by: David Elliott | last post by:
I have a Collection that inherits from CollectionBase and Implements IBindingList which I have bound to a DataGrid. So far everything works fine. However, I am missing one piece to the IBindingList that I haven't figured out yet, how to determine which DataGrid column header I clicked on so I can do a custom sort. Right now the sort is rotating just to see that everything works. There are two pieces of the IBindingList that I didn't...
1
2665
by: alex n | last post by:
hello. i'm trying to implement IBindingList to wrap DataTable (like DataView) with hierarchy capabilities and bind it to DataGrid. The problem is i don't know yet all the stuff i need to know. the current problem - what should i return in the IList indexer? definetely not DataRow object.
0
1472
by: Jongmin | last post by:
I met a problem when implementing IBindingList interface. I made CustomerList class, copied from MSDN, to implement CollectionBase and IBindingList. My problem took place after setting Datasource and adding new data. The system throw the following exception when I run "button1_Click", A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll Additional information: Specified argument...
5
6692
by: Matthew Woods | last post by:
bool A = Is this the right place to ask this question? if (A) { Where can i find a good example of an ArrayList bound to a datagrid that automatically updates the grid when the public data within the class contained in the arraylist is updated. i do not want to use datagrid.refresh() because the data updates randomly and often frequently and refreshing the whole grid several times a second is expensive and causes a flicker.
3
1794
by: Matthew Woods | last post by:
Hi, is there any way to format and order the columns displayed in a datagrid bound to a class that inherits from IBindingList? i have used DataGridTableStyle and added DataGridTextBoxColumns to it in the correct order which works fine if the dataGrid.dataSource = "ArrayList", but it doesn't work for my IBindingList wrapper. If i bind the datasource to the arraylist method then the ListChangedEventHandler is never invoked and my grid only...
0
1313
by: d pak | last post by:
Here is a snippit which replicates my issue. I have a datagrid which contains an input textbox on each row, binded on the serverside. However it seems that when I perform a postback to refresh teh numbers, they are not changing due to the foreach loop I have in this code. When I comment out the foreach loop, the numbers refresh fine (but the text boxs ovbiously no longer get created). I have placed this code in the OnItemDataBind method,...
2
12599
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's first column is a textbox(TemplateColumn), the other 3 columns are just display(BoundColumn). (1) if the value of the textbox is 0, then i'd like to change it null, so the box is empty
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.