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
Abdu Rafeeq
NA
113
264.2k
Call Function
Jun 10 2011 6:51 AM
I have two fuctions, they are given below
private
void
Form1_Load(
object
sender,
EventArgs
e)
{
//DgvColumnHeaderMerge d_obj = new DgvColumnHeaderMerge();
Form1
d_obj =
new
Form1
();
this
.dataGridView1.Columns.Add(
"dept_name"
,
"Name"
);
this
.dataGridView1.Columns.Add(
"dept_code"
,
"Code"
);
this
.dataGridView1.Columns.Add(
"emp_name"
,
"Name"
);
this
.dataGridView1.Columns.Add(
"emp_place"
,
"Place"
);
this
.dataGridView1.Columns.Add(
"emp_phone"
,
"Phone No"
);
// RowCreated(dataGridView2,e);
//dataGridView2.Rows.Add();
}
void
dataGridView1_RowCreated(
object
sender,
GridViewRowEventArgs
e)
{
if
(e.Row.RowType ==
DataControlRowType
.Header)
{
//Build custom header.
GridView
oGridView = (
GridView
)sender;
//DataGridView oGridView = (DataGridView)sender;
GridViewRow
oGridViewRow =
new
GridViewRow
(0, 0,
DataControlRowType
.Header,
DataControlRowState
.Insert);
TableCell
oTableCell =
new
TableCell
();
//Add Department
oTableCell.Text =
"Department"
;
oTableCell.ColumnSpan = 2;
oGridViewRow.Cells.Add(oTableCell);
//Add Employee
oTableCell =
new
TableCell
();
oTableCell.Text =
"Employee"
;
oTableCell.ColumnSpan = 3;
oGridViewRow.Cells.Add(oTableCell);
oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
}
}
How call the function?
void
dataGridView1_RowCreated(
object
sender,
GridViewRowEventArgs
e)
to form load?
here i want to sub header row for header row in datagrid view of windows application
Reply
Answers (
1
)
Create sub header row in DGV
FileSystemWatcher and reading from file