hii all,
i have two forms,
worker search form and childsearch form..
in worker search form, i have a button.. search child and textbox... number of children
if i click that, it will direct to child details form.....
in that i have datagrid.... the number of children are displayed ...
now the number of children present should be displayed in the number of children text box on worker search form....
can anyone plz tell me... how to get that..???
its very urgent...
plz help..
thnx...
hepsi..
5 1352
hii all,
i have two forms,
worker search form and childsearch form..
in worker search form, i have a button.. search child and textbox... number of children
if i click that, it will direct to child details form.....
in that i have datagrid.... the number of children are displayed ...
now the number of children present should be displayed in the number of children text box on worker search form....
can anyone plz tell me... how to get that..???
its very urgent...
plz help..
thnx...
hepsi..
This sounds like you want to do a count on the number of rows returned to your datagrid. Do a datagrid.Items. Count on your datagrid. This should give you the number of rows returned. Save this value in a session variable. Then in the page load of your worker page assign the value of the textbox to the value of the session variable.
Make sure that in the page load of your worker page you check to see if the session variable is null before assigning the value to the textbox. If it is null then you will know that datagrid has not returned any results yet.
Nathan
This sounds like you want to do a count on the number of rows returned to your datagrid. Do a datagrid.Items. Count on your datagrid. This should give you the number of rows returned. Save this value in a session variable. Then in the page load of your worker page assign the value of the textbox to the value of the session variable.
Make sure that in the page load of your worker page you check to see if the session variable is null before assigning the value to the textbox. If it is null then you will know that datagrid has not returned any results yet.
Nathan
thnx...
can u plz tell me how to declare a session.... and moreover im using vb.net windows application..?
i want somthing like, when i click close button in the search child form...,
i should able to get the row count of datagrid to the textbox of worker search from..
plz help....
thnx..
hepsi..
The best way would be to declare a public property in your child form, which you can then access from the calling parent form.
in C# it would look something like this:-
child form: -
private System.Data.DataSet searchResults = new System.Data.DataSet();
-
-
public System.Data.DataSet SearchResults
-
{
-
get { return searchResults; }
-
set { searchResults = value; }
-
}
-
-
protected void btnSearch_Click(object sender, EventArgs e)
-
{
-
//Do your search code, populating the searchResults DataSet
-
.
-
.
-
searchResults = <Your search results object>;
-
this.Hide();
-
}
-
Then in the parent form: -
protected void btnSearch_Click(object sender, EventArgs e)
-
{
-
frmSearchChild frm = new frmSearchChild();
-
frm.ShowDialog();
-
txtNumberOfRows.Text = frm.SearchResults.Tables[0].Rows.Count.ToString();
-
frm.Close();
-
}
-
Hope it helps!
The best way would be to declare a public property in your child form, which you can then access from the calling parent form.
in C# it would look something like this:-
child form: -
private System.Data.DataSet searchResults = new System.Data.DataSet();
-
-
public System.Data.DataSet SearchResults
-
{
-
get { return searchResults; }
-
set { searchResults = value; }
-
}
-
-
protected void btnSearch_Click(object sender, EventArgs e)
-
{
-
//Do your search code, populating the searchResults DataSet
-
.
-
.
-
searchResults = <Your search results object>;
-
this.Hide();
-
}
-
Then in the parent form: -
protected void btnSearch_Click(object sender, EventArgs e)
-
{
-
frmSearchChild frm = new frmSearchChild();
-
frm.ShowDialog();
-
txtNumberOfRows.Text = frm.SearchResults.Tables[0].Rows.Count.ToString();
-
frm.Close();
-
}
-
Hope it helps!
thnx...
hey can u plz tell me the code clearly in child form....
plz help..
its really very urgent,,,
thnx..
hepsi
That I can't do - I have no idea how you're search works!!!! Remember that I used a DataSet as an example, you can make your searchResults property return any object type...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Andrea Trevisan |
last post by:
That's a revival of a known thing I suppose.I hope it's useful.
My problem was:
I want to have a DataGrid with two Template columns: first with
TextBox,second with Button.I want to fire an event from
button and I want to have a reference to TextBox to make use of it.The
most difficult was the reference to TextBox.
This sample is taken from MCAD/MCSD Exam 70-305/70-315 of Microsoft
Press.This book is much more exhaustive than the brief...
|
by: Amadelle |
last post by:
Hi all and thanks in advance for your help,
I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template columns to show some of the columns. Few of the columns have textboxes to make them available for editing. I am trying to update the dataset all at once using one update button. Here is my code... (for simplicity I have only listed one of the...
|
by: Martin Hazell |
last post by:
For various reasons, I have had to produce a quick (!) page to edit one column of data in a database with ASP.net. With this being my first foray into ASP.net, I apoligise for any basic erros I have made.
The main problem is when setting up an ASP.net datagrid, which I can edit the single value of a specific column. I have wired up the update and edit methods to change the current edit row. I worked through the example in the MSDN help to...
|
by: Amadelle |
last post by:
Hi all and thanks in advance for your help,
I have a problem with capturing the changed value of a text box in a
datagrid. The datagrid is populated based on a dataset and I am using
template columns to show some of the columns. Few of the columns have
textboxes to make them available for editing. I am trying to update the
dataset all at once using one update button. Here is my code... (for
simplicity I have only listed one of the...
|
by: Maziar Aflatoun |
last post by:
Hi everyone,
I have this DataGrid that I bind to a DataTable. However, instead of
displaying the column 'Qty', I like to place it in a textbox and display the
value of Qty as the default value for the TextBox. Any suggestions?
<asp:datagrid id="DGShoppingCart" runat="server" Width="650"
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="ProductName" HeaderText="Product"
| |
by: tshad |
last post by:
I cannot seem to get the asp:textbox to use classes. Style works fine. I
am trying to set the textbox to act like a label in some instance so it
doesn't have a border, readonly and the background is grey.
I have a class set as:
..table2Label{
border-style:none;
background-color:#F6F6F6;
}
|
by: John Shum |
last post by:
I prepare a UserControl that act as a lookup control, once the code is
enter in the TextBox, the description will appear in another TextBox
outside the UserControl of the same row in a DataGrid via javascript.
I attempt to get the client ID of the TextBox (with provided ID of that
TextBox as "ext_desc") by the following code inside the Page_Load()
event of the UserControl (named Color_Control):
for(int i = 0; i < DataGrid1.Items.Count;...
|
by: ismaelf |
last post by:
i have a textbox in a template column in a datagrid, it displays the
initial value of the row, but when i change it remains with the
original value (it doesnt get the new value..)
i fill the CartTable programmatically with rows from a database binded
datagrid..
i cant figure out what is wroooong! hehe thanks for helping
here is my code:
TABLE CODE (in the page_load):
If Session("shop_cart") Is Nothing Then
|
by: rn5a |
last post by:
A DataGrid has a BoundColumn, an EditCommandColumn & a few
TemplateColumns. When the text in the EditCommandColumn within any of
the DataGridItems is clicked, the corresponding BoundColumn changes to
a TextBox.
How do I get the ID of such a TextBox?
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |