This is a migrated thread and some comments may be shown as answers.

Cannot set value of RadNumericTextBox when checking for session datatable

2 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave Miller
Top achievements
Rank 2
Dave Miller asked on 20 Sep 2008, 05:32 PM
I cannot set the value (and I've also tried the text) of a RadNumericTextBox when checking for a session datatable returns true. I am trying to set the value from the session datatable. If the check returns false it sets the value but if true the RadNumericTextBox is blank. I've even tried commenting out everthing when true and just setting the value to no avail. The version for this site is 2008.1.415. Could it be a bug (that maybe was fixed later) or am I missing something. Please see code below.

Any help would be greatly appreciated

Dave


private void ProcessQuoteRequests()

{

if (((DataTable)Session["DtQuoteRequest"]) != null)

{

//txtQuantity.Value = 5;

DataTable dt = new DataTable("dtQuoteReqTemp");

dt = (

DataTable)Session["DtQuoteRequest"];

DataRow dr = dt.Rows.Find(intProdID);

if (dr == null)

{

phAddToQuote.Visible =

true;

phAddedQuote.Visible =

false;

lblQuantity.Visible =

false;

TempLabel.Text =

"";

txtQuantity.Value = 1;

}

else

{

TempLabel.Text =

"Successfully added to quote request";

phAddToQuote.Visible =

true;

lblQuantity.Text = dr[

"Quantity"].ToString();

txtQuantity.Value =

Convert.ToInt32(dr["Quantity"].ToString());

phAddedQuote.Visible =

true;

}

}

else

{

phAddToQuote.Visible =

true;

txtQuantity.Value = 1;

}

}

2 Answers, 1 is accepted

Sort by
0
Dave Miller
Top achievements
Rank 2
answered on 21 Sep 2008, 03:31 PM
I have been able to solve this by moving the logic for setting the value for the RadNumericTextBox to its PreRender Event which now works fine.

Best regards,
Dave
0
Esther Nirmala
Top achievements
Rank 1
answered on 03 Aug 2011, 08:16 AM

Hi

    I am using Rad numeric text box in my page. Am trying to set the value of numeric text box on seleting a drop down list. But its not displaying the data. And i tried to set the value in prerender of text box also.. that is also not working . How to set the value of rad numeric text box in code behind. If i assign directly to value property its working.. If am assigning from viewstate its not working.

   protected void dropDownListResource_SelectedIndexChanged(object sender, EventArgs e)
        
radNumericTextboxRate.Value = this.ResourceController.State.ResourceClientTypeCharge.DailyRate;
 //      radNumericTextboxRate.Value = 123;
}

how to set text from viewstate in rad numeric text box.. I tried in prerender event too..  but no progress :(:(

Thx
nirmal
Tags
General Discussions
Asked by
Dave Miller
Top achievements
Rank 2
Answers by
Dave Miller
Top achievements
Rank 2
Esther Nirmala
Top achievements
Rank 1
Share this question
or