473,394 Members | 1,761 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,394 software developers and data experts.

Column Width in DataGrid When using DataView

How do I set the column width in a datagrid when the datasource is a
dataview? I want to use a dataview so data changes, inserts, and deletes are
disabled.

I can set the column width when I use the DataTable that underlies the
DataView as the DataSource in the DataGrid. When I use the DataTable name as
the MappingName in the DataGridTableStyle, it works like a charm.

However, when I change the DataGrid.DataSource to the DataView, I don't know
what MappingName to put in its DataGridTableStyle. No matter what I put as a
MappingName, the values in the GridColumnStyles.columnwidth are ignored. The
column names show up in the combobox in the GridColumnStyles so it sees data
from the dataview.

Any ideas on what I should do?
--
Price Brattin
Certified MBS/Solomon Consultant
SQLServer MCP
VB.Net Developer

Nov 21 '05 #1
1 2737
Hi,

The mappingname for the dataview will be the same as the
datatable's.

Ken
-----------------
"Price Brattin" <pb******@buenosw.com.(donotspam)> wrote in message
news:23**********************************@microsof t.com...
How do I set the column width in a datagrid when the datasource is a
dataview? I want to use a dataview so data changes, inserts, and deletes
are
disabled.

I can set the column width when I use the DataTable that underlies the
DataView as the DataSource in the DataGrid. When I use the DataTable name
as
the MappingName in the DataGridTableStyle, it works like a charm.

However, when I change the DataGrid.DataSource to the DataView, I don't
know
what MappingName to put in its DataGridTableStyle. No matter what I put as
a
MappingName, the values in the GridColumnStyles.columnwidth are ignored.
The
column names show up in the combobox in the GridColumnStyles so it sees
data
from the dataview.

Any ideas on what I should do?
--
Price Brattin
Certified MBS/Solomon Consultant
SQLServer MCP
VB.Net Developer

Nov 21 '05 #2

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

Similar topics

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: VMI | last post by:
My Windows datagrid has two columns: one with the data that the user will see (col_X) and the other one (a hidden one: col_sort) that'll be used to sort data. When a user clicks on col_X's column...
1
by: Dmitry V. Markin | last post by:
Good day! Here is my problem: I need to have a radiobutton column in my DataGrid for a representation of a bool column, where only row can be checked at one time(only one value in bool column...
6
by: Agnes | last post by:
I understand it is impossible, but still curious to know "Can I freeze several column in the datagrid, the user can only scroll the first 3 columns (not verical), for the rest of the coulumn, it is...
8
by: Doug Bell | last post by:
Hi, I need to create a function that will return the number of columns in a passed reference to a DataView. I can find the number of columns in its underlying Data table but have not been...
5
by: Bruce D | last post by:
Is there a way to programatically set the format of just one column in a datagrid? I have a datagrid bined to a datasource. My dataview has 6 columns. And I want to format one column...
5
by: Rich | last post by:
I have a datagrid that uses a dataview object for its datasource. The dataview contains a unique row identifier column. I don't want to display this column in the datagrid. I need the unique row...
9
by: Steve | last post by:
How I can remove an AutoGenerated column? I wnat to inlcude the primary key in the resultset for creating some custom LinkButtons, but I don't want it (the PK) displayed in the DataGrid. I tried...
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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,...

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.