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

Default value in a column when using TableStyle in DataGrid?

Is it possible to asign a default value to a cell in a DataGrid column when
using TableStyle as well?

I have an ID column with a width= 0 that has to have a default ID value when
the user adds rows in the datagrid.

/Lars
Nov 20 '05 #1
5 1990
I used the NullText for this, although I'm not sure that's good if the
Column is not null and I still need it to be a defautl value

/Lars

"Lars Netzel" <[no_spam_please]la*********@qlogic.se> skrev i meddelandet
news:%2****************@TK2MSFTNGP10.phx.gbl...
Is it possible to asign a default value to a cell in a DataGrid column when using TableStyle as well?

I have an ID column with a width= 0 that has to have a default ID value when the user adds rows in the datagrid.

/Lars

Nov 20 '05 #2
Hi,

Set a default value for the datacolumn.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q897q

Ken
--------------
"Lars Netzel" <[no_spam_please]la*********@qlogic.se> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Is it possible to asign a default value to a cell in a DataGrid column
when
using TableStyle as well?

I have an ID column with a width= 0 that has to have a default ID value
when
the user adds rows in the datagrid.

/Lars

Nov 20 '05 #3
Thankx, but can't use that I think.. I'm using three datagrids in a
master/detail way and Dataview to filter the content that I add as
datasource... and I need to set a new default value depending on what row is
selected in the grid above.

The Nulltext seemes to work from the ColumnStyle thingy!

/Lars
"Ken Tucker [MVP]" <vb***@bellsouth.net> skrev i meddelandet
news:Op**************@TK2MSFTNGP09.phx.gbl...
Hi,

Set a default value for the datacolumn.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q897q

Ken
--------------
"Lars Netzel" <[no_spam_please]la*********@qlogic.se> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Is it possible to asign a default value to a cell in a DataGrid column
when
using TableStyle as well?

I have an ID column with a width= 0 that has to have a default ID value
when
the user adds rows in the datagrid.

/Lars


Nov 20 '05 #4
Hi Lars,

I misreaded your question 10 times I think. Probably because someone was
strange complaining yesterday in another newsgroup how to set the default
size of a column.

However why can you not set the default value of an underlaying datasource.
You are telling the default value from a datatable.column, not from the
item itself.

So when you have three tables with 1000 columns you can set every column/

If you do not understand it, ask again?

Cor

Nov 20 '05 #5
I have fixed it, thanx though!
Dim drCurrent As DataRowView = BindingContext(dvProjCodes).Current

DataGrid1.TableStyles.Item(0).GridColumnStyles(6). NullText =
drCurrent.Item("PRCO_ID")

/Lars

"Cor Ligthert" <no**********@planet.nl> skrev i meddelandet
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Lars,

I misreaded your question 10 times I think. Probably because someone was
strange complaining yesterday in another newsgroup how to set the default
size of a column.

However why can you not set the default value of an underlaying datasource. You are telling the default value from a datatable.column, not from the
item itself.

So when you have three tables with 1000 columns you can set every column/

If you do not understand it, ask again?

Cor

Nov 20 '05 #6

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

Similar topics

3
by: bismarkjoe | last post by:
Hello, I am trying to set the widths on the columns of a DataGrid component, and I'm not sure if I'm doing it correctly. My code is below: //load some inital data table = db.GetDataTable(...
3
by: PeterZ | last post by:
Hi, In a running C# app with a datagrid control I select all rows in the dataGrid using CTRL-A, I then paste into some other app like notepad or Word but the column headings get left off. Is...
2
by: Hajash | last post by:
hi all, how do i set the width of a column in a datagrid.Please help.Thanks in advance. regards, hajash
1
by: ElenaR | last post by:
I need to figure out how to name my column headers in a DataGrid. In VB6, I could write DataGrid1.Columns(0).Caption = "ID". What is the format for VB.NET? Thanks in Advance!
17
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5...
1
by: Jorge | last post by:
Hello All I am trying to preserve the width of column in a datagrid made by the user. On form load i use this <code> Me.DataGrid2.TableStyles("artenc").GridColumnStyles (0).Width = 30...
3
by: Reza G. | last post by:
I am creating a window forms, and placed a datagrid on it. Set the DataSource and DataMember, and I get all the column in the table (relation) shown. I used TableStyles of the DataGrid and add a...
4
by: Rich | last post by:
Hello, I have a one datagrid that will be based on different datatables. One datatable may have 7 columns, another 15... With the tables that have more columns, I have been manually dragging...
4
by: Localbar | last post by:
hi all, If I have a datagrid, actually has 5 column. but I would like in run time hidden last column. The reason is the form also have combobox for filter datagrid row. my problem is that I...
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
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?
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
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...

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.