|
Hi! yes it is raised. sending you the full source which i didnt added earlier.
Delegate Sub TreeNodeSelectedIndexChanged(ByVal Sender As Object, ByVal e As System.EventArgs)
Public Event TreeNodeChanged As TreeNodeSelectedIndexChanged
Public Sub SubscribeTreeNodeChanged(ByVal Del As TreeNodeSelectedIndexChanged)
AddHandler TreeNodeChanged, Del
End Sub
Public Sub UnSubscribeTreeNodeChanged(ByVal Del As TreeNodeSelectedIndexChanged)
RemoveHandler TreeNodeChanged, Del
End Sub
---
Protected Sub tvProperty_SelectedNodeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles tvProperty.SelectedNodeChanged
Me.LocationId = tvProperty.SelectedNode.Value
If dgBuildingComponent.SelectedIndex <> -1 Then
Dim KeyID As Integer = CType(dgBuildingComponent.DataKeys(dgBuildingComponent.SelectedIndex), Integer)
Me.BuildingComponentId = KeyID
Else
Me.BuildingComponentId = 0
End If
bindBuildingComponent()
RaiseEvent TreeNodeChanged(sender, e)
End Sub
thanks
|
|
|
|
|
CType(gvProperty.Rows(0).FindControl("txtPV"), TextBox) using this iam to get the textbox and also i write text iam getting the text but how i can change the forecolor to blue of that text box in the grid view
|
|
|
|
|
Does this code not work for you?
txt = CType(gvProperty.Rows(0).FindControl("txtPV"), TextBox)<br />
txt.ForeColor = Colors.Red
then, you can define the CSS class and set it to Textbox control..
|
|
|
|
|
Hello Everyone,
I am new to code project and i have a small scenario : i created a small web form for student details. in that, i placed a "dropdown listbox and a text box".
in dropdownbox(ddb), i added 3 items i.e., marks of a student in paper1,paper2,paper3 respectively.
now, i want to select paper1 from the "ddb" and enter the marks in the text-box.
next,i want to select paper2 from the "ddb" and enter the marks in the same text-box.
likewise for the paper3.
and, when i click a button, i would like to see the total.
below is the sample code i used. can anyone please suggest me how to implement this.
Also, please let me know if this is completely stupid thought.
private void Page-Load(....)
{
if(DropDownList1.SelectedIndex==0)
{
MsgBox1.alert("p1");
}
}
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(DropDownList1.SelectedIndex==1)
{
MsgBox1.alert("p2");
}
if(DropDownList1.SelectedIndex==2)
{
MsgBox1.alert("p3");
DropDownList1.SelectedIndex=0;
}
}
|
|
|
|
|
this is pumpkin wrote: MsgBox1.alert("p1");
This is obviously test code, but either way, remember this won't work in the real world
this is pumpkin wrote: private void Page-Load(....)
Page_Load is a strange place to do this. You should have a submit button and handle it's event.
You've written some very simple test code. If you move beyond that and try to write code that does what you want, you should find soon enough the limitations of hte approach ( for example, if I change my drop list, should the existing value for that selected test be shown right away ? )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Are you tired to answer this kind of questions?
|
|
|
|
|
when before textbox in the gridview it was a label so it is to reconize the cell in that by giving gridview1.row(0).cells(1).forecolor ="blue" but now iam keeping a textbox in the template field of a grid view that first cell now it was difficult to reconise.how it can be reconize
|
|
|
|
|
i have a datagrid ..in that two columns are there ....seats.and checkboxes
i am getting the seats value from the database...
my problem is if the seats value is more tha 0 ..then only the checkbox should be visible...
if the value is lessthan or equal to 0 ..then the checkbox should be invisible
how can i do this in asp.net
|
|
|
|
|
By setting the visible property on both controls, and putting them in one column, which is also dynamically named.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use the GridView.RowDataBound Event and for each new generated row check the seats value (e.Rows.Cells[0].Text) and change the checkbox visibility accordingly. e.Rows.Cells[1].FindControl(checkbox)....
|
|
|
|
|
How can I create a browse button (option) that will allow me to browse and get the path where later I am going to save files to ? I need a path not the file name like control input file does. Thank you very much !
|
|
|
|
|
Well, you're not going to save files to the local file system, so how would this be useful ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
bircut wrote: How can I create a browse button (option) that will allow me to browse and get the path
You mean, input type="File" ?? It's already there. Why do you want to create new?
bircut wrote: later I am going to save files to ?
I'm not sure what you meant. If you are using file input, you can browse the file and upload it to Server.
bircut wrote: I need a path not the file name
As Microsoft says here[^], it's not possible.
|
|
|
|
|
Simply, I just want to create a folder browser dialog in asp.net.
Well, let me explain it. A customer order a list of picture to be printed. I want to use something like folder browser dialog to chose a folder and then search if these picture exist in this folder. Then I'll copy all these picture into a new folder (called Printed_Picture). Picture in Printed_Picture folder will be printed.
control is used to choose a file not a folder.
modified on Thursday, January 03, 2008 11:25:12 PM
|
|
|
|
|
Your boss is an idiot. You can't do that. Well, if you write a browser plug in, you might, but using ASP.NET you simply cannot.
Why would you want a web app that moves files about on the client PC ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
A customer order a list of pictures to be printed. He want to use something like folder browser dialog to chose a folder and then search if these pictures exist in this folder. Then he want copy all these pictures into a new folder (called Printed_Picture). Pictures in Printed_Picture folder will be printed.
modified on Thursday, January 03, 2008 11:53:16 PM
|
|
|
|
|
They are printed by a service, or the browser is being used to do something entirely client side, and IE is just being used to print local pictures ? If the image is being printed locally, write a little app they can download and run, what's the point of it running in the browser ?
Either way, HTML/javascript does not allow you to wander about the users file system, and with good reason.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Well, many pictures the capacity is too large and it isn't wise to store them on server. The server only store the thumbnails of these pictures. These pictures is stored in the local desktop in my company. The thumbnail picture and the original picture has the same file name.
The order of a customer always take average 200~300 pictures, it is hard to find one by one in a folder. Then my boss need a control in my company website to search the list of pictures in a chosen folder, then copy them into to Printed_Piture folder. He will choose picture from a folder on his own desktop after checking order, not on a server computer.
modified on Friday, January 04, 2008 12:57:03 AM
|
|
|
|
|
Hi all,
I am developing a asp.net c# web application. In which on a specific condition in a code behind page I want to take the client confirmation, How can I achieve this.
eg: If a client has given some input. I will check the input is already exist using the code behind(server side) and then I want to take a confirmation "does he want to overwrite his new input?". I can't do the checking using the client side script.
any help is appreciated.
Thanks in advance.
-Ram.
|
|
|
|
|
Your two options then are a postback, or AJAX. you would use client side script if you want to show a confirmation message, there's just no way around that, but you can do a postback or AJAX call to check if you want to show the message.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Christian Graus,
Thanks a lot for your response.
-Ram
|
|
|
|
|
Hi ,
I am facing a typical problem where the same piece of code works at one place and does not at some other place.
The problem is that the check box list does not show me the previous page checked items when I return to the previous page after doing some selections in the next page...
I have used this in the code "$$$ The Problem Occurs Here $$$ " to denote where the problem occurs
The following is the code.
private void RememberOldValues()
{
ArrayList CheckedIndex = new ArrayList();
int index = -1;
for (int i = 0; i <GridView_TestCase.Rows.Count;i++ )
{
GridViewRow row = GridView_TestCase.Rows[i];
index = (GridView_TestCase.PageIndex*GridView_TestCase.PageSize)+i;
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
if (Session["CHECKED_ITEMS"] != null)
CheckedIndex = (ArrayList)Session["CHECKED_ITEMS"];
if (isChecked)
{
if(!CheckedIndex.Contains(index))
CheckedIndex.Add(index);
}
else
CheckedIndex.Remove(index);
}
if (CheckedIndex != null && CheckedIndex.Count > 0)
Session["CHECKED_ITEMS"] = CheckedIndex;
}
//Method to repopulate checked index in GridView_TestCase
private void RePopulateValues()
{
ArrayList CheckedIndex = (ArrayList)Session["CHECKED_ITEMS"];
int index = -1;
if (CheckedIndex != null && CheckedIndex.Count > 0)
{
for (int i = 0; i < GridView_TestCase.Rows.Count; i++)
{
GridViewRow row = GridView_TestCase.Rows[i];
index = (GridView_TestCase.PageIndex * GridView_TestCase.PageSize) + i;
//Use If..Else here when the Second Grid View is ready
if (CheckedIndex.Contains(index))
{
CheckBox CheckItem = ((CheckBox)row.FindControl("chkSelect"));
CheckItem.Checked = true;
}
}
}
}
public void gv_MetaDisplay_PageIndexChanging(Object sender, GridViewPageEventArgs e)
{
RememberOldValues_MetaData();
gv_MetaDisplay.PageIndex = e.NewPageIndex;
RePopulateValues_MetaData();
}
private void RememberOldValues_MetaData()
{
ArrayList CheckedIndex = new ArrayList();
ArrayList TestSaved = new ArrayList();
int index = -1;
for (int i = 0; i < gv_MetaDisplay.Rows.Count; i++)
{
GridViewRow row = gv_MetaDisplay.Rows[i];
index = (gv_MetaDisplay.PageIndex * gv_MetaDisplay.PageSize) + i;
bool isChecked = ((CheckBox)row.FindControl("chkDataSave")).Checked;
if (Session["CHECKED_SAVEITEMS"] != null)
{
CheckedIndex = (ArrayList)Session["CHECKED_SAVEITEMS"];
TestSaved = (ArrayList)Session["CHECKED_TESTNAMES"];
}
if (isChecked)
{
if (!CheckedIndex.Contains(index))
{
{
CheckedIndex.Add(index);
TestSaved.Add(row.Cells[1].Text);
}
}
}
else
{
CheckedIndex.Remove(index);
TestSaved.Remove(row.Cells[2].Text);
}
if (CheckedIndex != null && CheckedIndex.Count > 0)
{
Session["CHECKED_SAVEITEMS"] = CheckedIndex;
Session["CHECKED_TESTNAMES"] = TestSaved;
}
}
}
private void RePopulateValues_MetaData()
{
ArrayList CheckedIndex = (ArrayList)Session["CHECKED_SAVEITEMS"];
int index = -1;
if (CheckedIndex != null && CheckedIndex.Count > 0)
{
for (int i = 0; i < gv_MetaDisplay.Rows.Count; i++)
{
GridViewRow row = gv_MetaDisplay.Rows[i];
index = (gv_MetaDisplay.PageIndex * gv_MetaDisplay.PageSize) + i;
//Use If..Else here when the Second Grid View is ready
//$$$ The Problem Occurs Here $$$
if (CheckedIndex.Contains(index))
{
CheckBox CheckItem = ((CheckBox)row.FindControl("chkDataSave"));
CheckItem.Checked = true;
// CheckItem.Visible = true;
//lbl_test.Text = CheckItem.Text;
// Response.Write(CheckItem.Text);
}
}
}
}
}
please help me.//
Thanks ,
Nickle
Happy Programming!
Regards,
Nikhil Pagidala
|
|
|
|
|
When you say 'the problem occurs here', what does the debugger tell you ? Is the list you check against empty ? Are the Ids changing ? What's causing the test to fail ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
HI .thanks for your reply.. It is taking the boolean true... But it is not displaying on the page.. as checked
Happy Programming!
Regards,
Nikhil Pagidala
|
|
|
|
|
if (CheckedIndex.Contains(index))
{
CheckBox CheckItem = ((CheckBox)row.FindControl("chkDataSave"));
CheckItem.Checked = true;
// CheckItem.Visible = true;
//lbl_test.Text = CheckItem.Text;
// Response.Write(CheckItem.Text);
}
So, the control is found, it's checked property is set to true, but it's not checked ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|