TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pieter Twentyeight
NA
37
11.3k
DataSET rename columns and autformat width size
Dec 10 2012 6:13 AM
In my N Tier application, I have a dataset with following code:
try
{
int acid;
acid = Convert.ToInt32(textBoxActivityNumber.Text);
_localds = new DataSet("CRMBCC");
_localds = myActivity.GetAllServiceRequestsFromActivity(acid);//acid
dataGridViewActivityServiceRequest.DataSource = _localds.Tables[0];
//Make unvisible columns
dataGridViewActivityServiceRequest.Columns["ActivityId"].Visible = false;
dataGridViewActivityServiceRequest.Columns["ServiceRequestId"].Visible = false;
dataGridViewActivityServiceRequest.Columns["ActivityServiceRequestId"].Visible = false;
dataGridViewActivityServiceRequest.Columns["Description"].Visible = false;
dataGridViewActivityServiceRequest.Columns["Comments"].Visible = false;
dataGridViewActivityServiceRequest.Columns["OperationNumber"].Visible = false;
dataGridViewActivityServiceRequest.Columns["ProductId"].Visible = false;
dataGridViewActivityServiceRequest.Columns["ProductId1"].Visible = false;
dataGridViewActivityServiceRequest.Columns["Active"].Visible = false;
dataGridViewActivityServiceRequest.Columns["Type"].Visible = false;
dataGridViewActivityServiceRequest.Columns["Line"].Visible = false;
//Order columns
dataGridViewActivityServiceRequest.Columns["ServiceRequestId1"].DisplayIndex = 1;
dataGridViewActivityServiceRequest.Columns["Area"].DisplayIndex = 2;
dataGridViewActivityServiceRequest.Columns["SubArea"].DisplayIndex = 3;
dataGridViewActivityServiceRequest.Columns["Name"].DisplayIndex = 4;
dataGridViewActivityServiceRequest.Columns["Priority"].DisplayIndex = 5;
dataGridViewActivityServiceRequest.Columns["Status"].DisplayIndex = 6;
dataGridViewActivityServiceRequest.Refresh();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Activity Service Requests",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Now I would like to give the visible columns another more meaningfull name AND I would like to autoformat the width of the columns?
Can someone help me with this?
Kind regards!!
Reply
Answers (
0
)
Sql query on joins
How to convert time to datetime