15,897,187 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Vivek VIshwas (Top 25 by date)
Vivek VIshwas
20-Nov-17 4:44am
View
i did not get your point?
Vivek VIshwas
20-Nov-17 4:42am
View
Thank You so much @Sir, Its working fine, But it is still not a proper solved according to requirement. I added 2 more record under Preet vihar, Buts code is not crating a node to expand preet vihar to see it child node. you may check please. because i dont want to have any limitation on it, suppose Under INDIA -> Delhi -> Preet Vihar -> Preet Vihar A, Preet Vihar B,, Preet Vihar B-> Preet Vihar B.a. I want to have such a hierarchy for this where we can add n number of child to it parents
Vivek VIshwas
18-Nov-17 2:28am
View
please check and help me urgently sir...
Its going to be very difficult to resolve this issues.
My Project just stooped at this position.
Vivek VIshwas
18-Nov-17 1:45am
View
click here to get all the files
and i have also posted an image as my desired result output
http://www.c-sharpcorner.com/forums/how-to-create-a-report-in-database-table-as-treeview-design
Vivek VIshwas
18-Nov-17 1:43am
View
i didnot get understand..
Vivek VIshwas
18-Nov-17 1:08am
View
how do i attach screenshot ?
Vivek VIshwas
17-Nov-17 4:33am
View
Suppose i have a table that contains Pid , Cid, Pnamem Cname, Srno.
in my table cid is repeating multiple times in pid column.
Now , i want to show all data in grid view, its showing fine. as my grid view binding process is going on in code behind i have to find pid of reach row to check that is pid has repeating more than once. if yes, at the same time i want to automatically create a grid view to show the data according to each row of pid if pid is more than one time.
let's see.
Srno Id Pname cid Cname Cqty
11 0 15 America
12 15 America 1510 New Jursy 10
13 15 America 1511 New Jersy 5
i write a code to bind the data in to grid view
sql query is like this - select cid, cname from TopBill where Pid=0
you will get the result like -
CId Cname
15 America
Now as the above data is beinding in grid view , we have to check the grid view row and find the Cid, and if CId is in PId Column we have to create grid view to bind the data according to founded ID.
This is what i need
Vivek VIshwas
17-Nov-17 3:27am
View
string pid = GridView1.Rows[0].Cells[5].Text;
the above code describe that row one ki 5th column ki value jo hogi wo PId hoge. or ye each time ek hi hogi q ki ye to 1st row ko hi check kr rha h hme each ro ko check krna h
Vivek VIshwas
17-Nov-17 3:14am
View
ok, sir did you understand my question.
lets explain once again in hindi.
jaise suppose ki ek table h jiske data ko hmne grid view me bind kr diya.
Ab jaise hi grid view bind hua waise hi hme us grid view kr each row ko check krna ki kya jo row id h wo hamare table me 1 se jayda baar repeat ho rha h agr ho rha h to ek aotomatic grid view create ho or wo data is grid view me bind ho ab jaise hi ye grid view bind hua waise hi ab hme isme bhi check krna h kya is grid view ke id i mean PID ek se jayda time repeat ho rhi h table me agr haa to fir se same wahi automatic gridview create ho or usme is wali row ki id ke according data bond ho.
Vivek VIshwas
17-Nov-17 3:07am
View
Did you find my mail Sir?
Vivek VIshwas
17-Nov-17 2:57am
View
Can i have your email so that i could have more discussion please
Vivek VIshwas
17-Nov-17 2:57am
View
Sir, Your this line of code gives error
GridViewRow row = GridView1.SelectedRow;
string pid = row.Cells[0].ToString();
Vivek VIshwas
17-Nov-17 2:56am
View
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// DataTable dt = GetParentData(); // Get the Parent Data
// GridView1.DataSource = dt;
// GridView1.DataBind();
BindGrid();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
string pid = GridView1.Rows[0].Cells[5].Text;
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("Select * from TopBill where pid="+pid+""))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
//DataTable dtChild = GetChildData(pid); // // Get the Child Data based on the Parent ID selected
//GridView2.DataSource = dtChild;
//GridView2.DataBind();
}
private void BindGrid()
{
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("Select * from TopBill where Pid=0"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
}
Vivek VIshwas
17-Nov-17 2:54am
View
no it didn't help at all.
Vivek VIshwas
17-Nov-17 1:48am
View
check this one and solve the issues
Vivek VIshwas
17-Nov-17 1:47am
View
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// DataTable dt = GetParentData(); // Get the Parent Data
// GridView1.DataSource = dt;
// GridView1.DataBind();
BindGrid();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
string pid = row.Cells[4].ToString();
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("Select * from TopBill where Pid="+pid+""))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
//DataTable dtChild = GetChildData(pid); // // Get the Child Data based on the Parent ID selected
//GridView2.DataSource = dtChild;
//GridView2.DataBind();
}
private void BindGrid()
{
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("Select * from TopBill where Pid=0"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
}
Vivek VIshwas
17-Nov-17 1:46am
View
Deleted
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// DataTable dt = GetParentData(); // Get the Parent Data
// GridView1.DataSource = dt;
// GridView1.DataBind();
BindGrid();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
string pid = row.Cells[4].ToString();
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("Select * from TopBill where Pid="+pid+""))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
//DataTable dtChild = GetChildData(pid); // // Get the Child Data based on the Parent ID selected
//GridView2.DataSource = dtChild;
//GridView2.DataBind();
}
private void BindGrid()
{
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("Select * from TopBill where Pid=0"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
}
Vivek VIshwas
17-Nov-17 1:16am
View
But how to do it?
Vivek VIshwas
17-Nov-17 0:21am
View
of course !
Let me explain once again. I have a table, there is 5 column in that , Srno, Pid, Pname, CId, cName, cQty, and Pdetails. In my table cid is repeated more than once in Pid. I took a gridview to bind the all data from data base table. Now, gridview binding successfully, its fine. Now what i want suppose in gridview of first row id is 15 ( that is pid which is uniique in cId column ) how to generate another grid view to show data where pid=15 from table. and this will be happening again and again if any row id is repeating in Pid column . Now, tell me how to solve
Vivek VIshwas
16-Nov-17 23:38pm
View
I have to create a grid view dynamically from database and bind the grid view with data. In my above sql table there are multiple cID, i want to create automatically another grid view from from parent grid view row index id row id contains multiple record, means i want to create a nested grid view on generated gridview row index.
Vivek VIshwas
8-Nov-17 23:18pm
View
yes
Vivek VIshwas
8-Nov-17 3:40am
View
where is your improvement code...
Vivek VIshwas
8-Nov-17 3:24am
View
nothing because both variable doesn't holds any date
Vivek VIshwas
8-Nov-17 3:19am
View
the datatable you have used to store the "dates", that does not contains any data.
Please review the code.
Vivek VIshwas
8-Nov-17 3:11am
View
The above code is not generating the date please check Carefully. and update me. Thank You
Show More