473,654 Members | 3,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Grid Problem

h
I am using a datagrid control. I am displaying some controls like Date Time picker, combo boxes, ect in some cells.When a particuler cell is got focus the control is displayed and user select the value from combo or from date time picker control.When the focus is last the control disappeares and the value that user selected using the control is also lost. I want when focous is lost the value still remain there in the cell. How to do this.
Nov 16 '05 #1
3 1454
The value disapears or the selection ?

Ernest
"Qumer Mumtaz" <qa***@alrahmah soft.com> wrote in message
news:8E******** *************** ***********@mic rosoft.com...
hi
I am using a datagrid control. I am displaying some controls like Date

Time picker, combo boxes, ect in some cells.When a particuler cell is got
focus the control is displayed and user select the value from combo or from
date time picker control.When the focus is last the control disappeares and
the value that user selected using the control is also lost. I want when
focous is lost the value still remain there in the cell. How to do this.
Nov 16 '05 #2
Values is disapeared..... ..............t here is no value in the cell intially. When the cell got focus data time picker control apeare.o
I make a selction of date, so for as the focus is on the current cell data time picker is visible
when focus is lost the control is disappeared and value as well. What I wanna do is,when focus is lost the cell date time control must disappeare and the selected value becomes the current text of the cell.Just as happened in MS Project's Gentt Chart.
Nov 16 '05 #3
>When the cell got focus data time picker control apeare.ok

So you derived from DataGridColumnS tyle. Maybe you don't write the selected
value(in the DateTime picker) into the row of your datasource.

You should associate an eventhandler to the event
DateTime.Select edValueChanged. In this event handler you need to write
something like:

private void myDTPicker(obje ct sendere, EventArgs e)
{
this.ColumnStar tedEditing(this .myDateTimePick er);
}

You also should associate an event handler to the Leave event of the
DateTimePicker control

private void myDTPicker(obje ct sendere, EventArgs e)
{
myDTPicker.Hide ();
}

And finally, you should override the Commit method of the base class:

protected overrides bool Commit(System.W indows.Forms.Cu rrencyManager
dataSource , int rowNum )
{
if(rowNum>-1 && dataSource!=nul l)
this.SetColumnV alueAtRow(dataS ource, rowNum,
myDtPicker.Sele ctedValue);
}

Be also sure you are painting(in the Paint method) the value from the
DataSource, that is: (DateTime)this. GetColumnValue( source,rowNum)

Ernest

"Qumer Mumtaz" <an*******@disc ussions.microso ft.com> wrote in message
news:CB******** *************** ***********@mic rosoft.com...
Values is disapeared..... ..............t here is no value in the cell intially. When the cell got focus data time picker control apeare.ok I make a selction of date, so for as the focus is on the current cell data time picker is visible. when focus is lost the control is disappeared and value as well. What I

wanna do is,when focus is lost the cell date time control must disappeare
and the selected value becomes the current text of the cell.Just as happened
in MS Project's Gentt Chart.
Nov 16 '05 #4

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

Similar topics

2
4867
by: Jordan O'Hare | last post by:
Hello Everyone, I am after some help with the following: I have a windows application that contains a list box and two data grids. All three controls are binded to a dataset that contains five tables, and three relations that I want to take advantage of. Everything works fine however I want to use the data grid table style editor to make it look more presentable. Currently I have successfully done this
2
2028
by: kk | last post by:
Have 2 problems, any help is appreciated. Tab with Grids -------------- BL - fetching data from DB ( 5 secs - 10 rows) Grid Laod - 20 secs Grid Paint on tab change - 20 secs Problem: The data fetch only takes 5 secs, why does paint and load take 40 secs in total.
1
5104
by: Da-Breegster | last post by:
Hi. I'm attempting to write a roguelike (think nethack, crawl, angband, tome, adom, and yes, I suppose even rogue) in Perl and I've ran into a problem regarding the data structure for the map and handling it easily. A map is one 2D level, a simple grid. Each tile on the grid will be a hash of data about the grid. The map object itself has other bits of data, so that's why I don't just make the object an anonymous array: $map->{Map} = {...
1
2265
by: Rushabh Dadbhawala | last post by:
Problem: I am fetching data from the database, storing it in a dataSet, and binding it with a Data Grid. The DataGrid controls allows sorting. The problem is that when the data is sorted on one of the columns in the Data Grid, and I then try to retrieve the selected row using the "SelectedRowIndex", I get the row as per the original order of data. Eg: If the order of rows is: C - A - B, which after sorting becomes A - B - C. Now, if I...
2
2496
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is the OID of Person), the information of the person matching the selected OID is shown in the Textboxes (Name, Address, id, etc) and the courses this person is taken are shown in a DataGrid (course name, price, etc.). This is working well so far, I...
7
1580
by: Richard | last post by:
If the grid is dragged off the screen and back on the data is visible. Tried a dg.refresh() and Inactivate(). Can I do this by overriding custom base class OnPaint that my form inherits from? I don't thin it is the backcolor or something like that because the error does not occur on everyone's workstation. Could be it be the video card or tied to memory. Also when I get the error at the office computer if I remote connect to that...
3
2208
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of columns. & depending on what the user enters, the data grid can grow very large. So to avoid scrolling the whole page, I just want the data grid to be scrollable. For this I used the <div> tags around the data grid, <div...
5
2774
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
9
4012
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New DataTable("SliceInfo") Dim tblSliceRatings As New DataTable("SliceRatings") '.... All the adding datacolumns, datarows, etc. goes here.. DatasetInit.Tables.Add(tblSliceInfo)
6
2938
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1) Constraint pk_table1 Primary Key,
0
8290
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
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
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...
1
8489
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7307
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
6161
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
5622
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();...
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.