|
plz find me a sol to add pop up calender in gridview using c#
with regards
n.priya
priya
|
|
|
|
|
You mean to say, you wants a link in grid view and when user clicked on that link then open a popup clender ?
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
plz find me a solution to add pop up calender in gridview.
with regards
n.priya
priya
|
|
|
|
|
use a javascript calendar.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
how to set fontsize,color in .cs file(i know to do in .aspx page hw to do in codebehind.can anyone help me
with regards
priya
priya
|
|
|
|
|
You have been told how to do this already.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I have a Button(Select All Button) and a GridView a with a checkbox with columns EmployeeID, FirstName. GridView has paging enabled. After page loads, first, I check one check box from GridView's page one. I check another check box in page two. I hit Select All button. I need to get the employeeID values of those checked boxes from both pages.
With Below code, the problem is I, only get the employeeID from first Page not from second page?
How do I get the selected values from second page?
protected void SelectAll_Click(object sender, EventArgs e)<br />
{<br />
int employeeID;<br />
<br />
for (int i = 0; i < GridView1.Rows.Count; i++)<br />
{<br />
CheckBox chk = GridView1.Rows[i].FindControl("chkSelect") as CheckBox<br />
<br />
if (chk.Checked == true)<br />
{<br />
employeeID = Convert.ToInt32(GridView1.Rows[i].Cells[1].Text); <br />
}<br />
}<br />
<br />
}
CSharp Guy
|
|
|
|
|
Not so simple. On each postback, you need to store the ids of the checked items on that page, because that info is lost whenever you go to a new page. So, when your paging event occurs, first store the checked items, then you need to restore those values when you go back to that page index. You also need to remove unchecked items this way.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I have a gridview that contains a row of textboxes. Now, what I am looking for is the correct event (i.e. OnSelect) to use when the user clicks in the TextBox. I have viewed all of the events provided for the Textbox but see no such event.
Thanks,
Steve
|
|
|
|
|
Hi Steve,
Javascript would be help you.
What you want, you mean to say when user clicked on textbox then you want to do some operation.
Parwej Ahamad
R & D with IIS 5.0/6.0
modified on Wednesday, June 11, 2008 12:42 PM
|
|
|
|
|
There's no event, because, what use would it be ? If the user clicked on a textbox, and the page did a postback, how is that useful ?
As someone said, any interaction on that level, needs to happen with javascript. If you put an event on your control, such as onblur, ASP.NET will not recognise it, and will just pass it verbatim to the client.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
O.K. javascript is the way to go. The only problem I see is this. I will be using a hidden field on the page to store a gridview row index value. Now, because the gridview rows contain textboxes I can get the onClick event for the textbox; however, how do I identify which gridview row (index) , in the javascript, contains the textbox?
Thanks,
Steve
|
|
|
|
|
Your method that is called can pass 'this' as a parameter ( minus quotes ). This will be the actual textbox that you clicked. If you need the whole row, you may be able to get a parent property, or you can set the Ids of the textboxes to contain a row number.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I am developing a application which uses the update panel to refresh a gridview when changes are made in a dynamically loaded usercontrol which is loaded as one of the cells of the grid I am experiencing some strange issues firstly the grid is loading the control in the RowDataBound event and binding to the data in PageLoad this approach causes a problem when its time to update the data within the usercontrol due to the buttons event which updates the db fires after the PageLoad as you can determine the PageLoad will bind the grid to the db before the buttons update code as run so the changes will not get reflected. Now the problem arrises I put my data binding code as i would later on in the life cycle [onPreRender] so the button can update the db and changes will be rendered. but what happens is the buttons event handler in the control does not get triggered. but the async postback is taking place, the buttons click event works when the databinding code is in the Page_Load but but not this way in PreRender. i have had this problem for a couple of days now i dont know if its a issue with binding so late on in the cycle or related to the buttons events not getting registered.
I would much appreciate any feedback or advice.
Regards
Dan.
Dan
|
|
|
|
|
If you load a control during page load or later, then it won't exist early enough for viewstate to be restored, so no events will fire.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
hello!
i'm trying to consume a web service writing by a friend in a networking environment.The web service is on the server (main) i tested it there and it is working.
the web reference was done withtout a single problem.
my code takes data from the request either post or get.
to make sure it's working i pass the data that is supposed to be collected by the request object and that one is working to.i also display the value of the querystring passed in my codewith the response.write and is all fine there too.but each time i'm passing the value to the function i see the error Nullable object must have a value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Nullable object must have a value.
Source Error:
Line 49:
Line 50:
Line 51: decimal resp = (decimal)serv.getBalance(num, pin);
Line 52: Response.Write(resp);
Line 53: Response.Write(pin);
i debug it i they are not null and have the expected value.
i'm a lilte bit lost.and have this thing done before night. So i'll to have your opinion.
what do you think guys?
this are the codes
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
string text = Request["text"];<br />
string number = Request["number"];<br />
<br />
string[] t;<br />
<br />
t = text.Split(new Char[] { ' ',',' });<br />
dreamserve.iWalletMobileBasic serv = new dreamserve.iWalletMobileBasic();<br />
if (t[0].Trim() != "")<br />
{<br />
if(t[0].ToLower() == "foo")<br />
{<br />
if(t[1].Trim() !="" && number.Trim()!="")<br />
{<br />
string num = number.Trim();<br />
string pin = t[1].Trim();<br />
decimal resp = (decimal)serv.getBalance(num, pin);<br />
Response.Write(resp);<br />
<br />
}<br />
<br />
}<br />
}<br />
}<br />
even if i use number and t[1] directly itsthe same i tough it's due to empty space,casting that why i created pin and num.i really don't know what is wrong
please if it's possible get to me as quick as possible.Thanks guys!
eager to learn
|
|
|
|
|
highjo wrote: (decimal)serv.getBalance(num, pin);
Use decimal.TryParse to convert without it ever blowing up.
highjo wrote: if (t[0].Trim() != "")
{
if(t[0].ToLower() == "foo")
{
if(t[1].Trim() !="" && number.Trim()!="")
Wow - this is messy.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 friends ,
In my current project I have to host a dropdown list in gridview control.How to do that ?.It will be very helpful if you are providing some codes or links.Thank you all in advance
|
|
|
|
|
Just include the following in your gridview:
<asp:TemplateField HeaderText="Update" Visible="true">
<ItemTemplate >
<asp:DropDownList ID="" runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
We are not a Code Charity
|
|
|
|
|
can someone help with useful code i have the following in my codebehind
Public Function GetCust() As String
Return Session("CustCode")
End Function
And this in the aspx page
<asp:Label ID="Label1" runat="server" Text=<%# GetCust() %> ></asp:Label>
Can someone please tell me how to fix this and not to do it another way as i have to implement this method. I have simplified the above to get the point across.
thanks i hope someone can help its annoying me badly..
|
|
|
|
|
You should use <%= to get a string, <%# is for data binding statements.
thedom2 wrote: Can someone please tell me how to fix this
Of course, you haven't said what needs to be fixed, so I am guessing blindly.
Anotehr thing is, don't ever do this:
thedom2 wrote: Return Session("CustCode")
If you can't factor out all session access to a class, at LEAST store things like CustCode as constants, so you don't get a weird bug b/c somewhere else you typed Custcode instead.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 all!
I had a doubt , Does images will be compressed while storing images in to the database?
iam using file upload control to upload the images into the database.
while uploading iam converting the image into byte streem.
AND ALSO TELL ME WHAT IS THE COMPRESSION RATIO(IF COMPRESSED).
AND TELL ME WHAT IS THE DEFAULT IMAGE SIZE IN SQL SERVER?
PLEASE GIVE ME THE INFORMATION.
raj
|
|
|
|
|
If I were you, I would store the file location of the images rather then the actual images in the datavbase. You will very quickly find that your database size balloons.
Im not sure if it compresses them, my guess is they wont compress
We are not a Code Charity
|
|
|
|
|
.netman wrote: If I were you, I would store the file location of the images rather then the actual images in the datavbase
Definately the best way. Also saves the work of getting them back out of the database and displaying them.
Bob
Ashfield Consultants Ltd
|
|
|
|