|
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 )
|
|
|
|
|
So, the control is found, it's checked property is set to true, but it's not checked ?
Yes the above is true..
Please let me know how to solve it.
Thank you ,
Warm Regards,
Nikhil Pagidala
Happy Programming!
Regards,
Nikhil Pagidala
|
|
|
|
|
Hi,
I have one default.aspx page and many .ascx user controls that are displayed inside default.aspx page. There is always only one .ascx user control in the default page (placeholder) at one time. This page is added dynamicly in Page_Load of the default.aspx :
protected void Page_Load(object sender, EventArgs e)
{
this.LoadContent();
}
public void LoadContent()
{
this.placeholderContent.Controls.Clear();
this.placeholderContent.Controls.Add(this.LoadControl([...some mechanism how to get right file...]));
}
during Page_Load of currently loaded user control, it might happen that depending on user action this control requires to be changed to different .ascx user control , so LoadContent (in default.aspx ) is called to dump current control and load new one.
Problem occurs that when a new control is loaded after an old control was dumped, events (button clicks) of new added control are not registred properly. When a button on new control is clicked, it doesn't invoke the registered event during next postback. Event's start working from second postback on... (if the user control doesn't change)
thanx for help!
zilo
|
|
|
|
|
I thnk Page Load is too late to do this, you need to do it in the loadviewstate event for events to fire properly.
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,
thanx for answer, I'll try that.
zilo
|
|
|
|
|
Hi,
when adding controls to my placeholder in loadviewstate , they are not displayed at all
zilo
|
|
|
|