Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
540 views
Hi,

I am using ajaxified RadGrid with user control for edit form. On the user edit control I need a button 'Insert & Add another' which saves the current item and openes up empty edit control to add another item to the grid. I have added InsertAnother button on the edit control and I added the code below to acheive this in ItemCommand event. I also have a code on InitInsert to set a default value for a field on the user control, also shown below. When I click InsertAnother button it does  save the current item and open up the user edit control to add new item as expected  but ItemCommand event is never fired for the new insert control, so default value for TextBox1 is never being set. So, my question is, am I handling the InsertAnother button event correctly? Is there a better way to do it? If the way I handled is correct, why is ItemCommand event with InitInsert command name is not firing for new insert user control. Any help is greatly appreciated.

protected

 

void Grid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) {

 

 

//if IsertAnother button is clicked

 

 

if (e.CommandName == "InsertAnother") {

 

 

//insert and then set the grid to insert again to open up new item window

 

handleInsert(sender, e);

 

//if the event is not cancelled, set the grid in insert mode to insert another item and call rebind on the grid

 

 

if (!e.Canceled) {

 

Grid1.MasterTableView.IsItemInserted =

true;

 

Grid1.Rebind();

}

}

 

//if the user selected to do the insert

 

 

if (e.CommandName == RadGrid.InitInsertCommandName) {

 

e.Canceled =

true;

 

e.Item.OwnerTableView.InsertItem();

 

GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();

 

 

//fidn the edit control id

 

 

String userEditControlId = GridEditFormItem.EditFormUserControlID;

 

 

//get the edit control

 

 

UserControl userEditControl = insertedItem.FindControl(userEditControlId) as UserControl;

 

//get the text box1

 

 

 

 

RadTextBox TxtBox = userEditControl.FindControl("TextBox1") as RadTextBox;

 

TxtBox.Text = "10";
}
}

Thank you,
Ana

Tigger Tag
Top achievements
Rank 1
 answered on 22 Sep 2011
1 answer
95 views
hai i am using radrotator with textbox and button. in button click event i am setting the textbox value(ex. 5000) to hidden field.

And i am accessing that hidden field value in javascript to set the radrotator.set_Scrollduration(hiddenfieldvalue) but it is not working
Slav
Telerik team
 answered on 22 Sep 2011
2 answers
109 views
Hi,
i want to give option to uncheck only limited field. for example grid containing orderid,order name,ship name,shipping date.
in grid i need to give option to uncheck ship date and ship name only.i attached shapshot for this. please give suggestion how to fix.
Daniel
Telerik team
 answered on 22 Sep 2011
1 answer
96 views
Hi, I have a RadGrid that has multiple nested details tables and everything works great, except for this issue:

1.  search fields are not cleared out when moving from one record to the next.  This behavior can be seen under this demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/filteringdetailtables/defaultcs.aspx

If you type "14.40" under the Unit Price search field textbox, for record 10281, it filters by that price, but if you expand the record below it (10282), the Unit Price search textbox for that record is populated by "14.40", which makes it confusing since as an end-user it seems that the column for that particular row has been filtered by that value, and none is found, but yet records are still being displayed.  My question is, what is the best way to clear out the search fields for newly expanded records?  Thank you!
Andrey
Telerik team
 answered on 22 Sep 2011
4 answers
413 views
Not sure if i should be posting this here or not.

But i'm getting the above error on an ajaxified page. I can replicate the issue by trying to submit a form with requiredvalidators, and the page validation fails. (had to use firebug to find the error, because it just hanged on a loading panel).

There are other controls on the page that cause postbacks that seem to be ok. (comboboxes)

The pages run fine locally through the VS development server. It's obviously some kind of path issue,

is there a way i can find out where the file is, and what the path should be; then change it appropiately?

Alan
Alan T
Top achievements
Rank 1
 answered on 22 Sep 2011
3 answers
114 views
Hi newb here,

I'm guessing most of you will answer this in a heartbeat for for us newbies?

I have a simple test app that has one div that has no style except "color:red" and I have a RadNumericTextBox with the label property set. I expected the RadNumericTextBox to inherit the style (color:red) from its parent being the div to get a red label, but instead the label is black.

I know I can specify a LabelCssClass and specify the color but this leads to a more complex css structure (ie. I want to use the style with different colors without duplicating the code).

I've even tried specifying a css class that enforces the "color:inherit" with no sucess:

CSS

.colInherit

{

color:inherit;

}


HTML

<div style="color:Red">

    <telerik:RadNumericTextBox ID="RadTextBox1" runat="server" Label="Tester" LabelCssClass="colInherit" >
    </telerik:RadNumericTextBox >

</div>

Thanks in advance...

Andy

Stuart Hemming
Top achievements
Rank 2
 answered on 22 Sep 2011
1 answer
230 views
Can we integrate Rad rotator -coverflow mode in asp.net mvc.Please help
Slav
Telerik team
 answered on 22 Sep 2011
1 answer
147 views
I have following code in my Master Page C# Code. Its just throwing me error on "RadMenu1.DataSource = MenuCreation.ExecuteNonQuery();"
that Object Reference not found. This code does work elsewhere but just not working in Master Site. Can someone help. How can I use RadMenu in my master site

my stored procedure name is AllMenu which basically select all data from table name MyMenus
Also my stored procedure sql is simple. it is "SELECT id, text, (CASE WHEN parentid = 0 THEN  NULL ELSE parentid END) FROM MyMenus"

            SqlCommand MenuCreation= new SqlCommand();
            SqlConnection dbconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLDB"].ConnectionString);
            MenuCreation.Connection = dbconnection ;
            MenuCreation.CommandType = CommandType.StoredProcedure;
            MenuCreation.CommandText = "AllMenu";
            

            ConnectionState previousConnectionState = dbconnection.State;

            dbconnection.Open();
            RadMenu1.DataSource = MenuCreation.ExecuteNonQuery();


            RadMenu1.DataFieldID = "ID";
            RadMenu1.DataFieldParentID = "ParentID";

            RadMenu1.DataTextField = "Text";
            RadMenu1.DataValueField = "ID";
            RadMenu1.DataNavigateUrlField = "URL";

            RadMenu1.DataBind();      
Kevin
Top achievements
Rank 2
 answered on 22 Sep 2011
4 answers
90 views
Hi,

I have a weird issue with radwindow controls in my project. I have a grid with an edit linkbutton column which opens a radwindow with details for that particular item. Inside of this radwindow I have another grid with a edit column in it which also opens another radwindow using oBrowserWnd.radopen to show the details of the selected grid item. Everything so far works fine, the bug I'm encountering is that if the edit template field is an img tag the radwindow will appear behind the currently open radwindow but if I switch the img tag for a regular anchor tag which uses the exact same js code to open the window, the actual window is displayed properly in front of the parent window. Now I've tried to further test this by using an anchor tag with text set to "Edit" and it has an img tag as its child. Now, if I click on the "Edit" text the radwindow opens up fine in the front of the current radwindow but if I click on the img tag nested inside the anchor the radwindow opens but its behind the current radwindow. This is way weird. Any ideas on how to resolve this issue?

Best regards.
John Schroeder
Top achievements
Rank 1
 answered on 22 Sep 2011
2 answers
127 views
I am trying to bind data to a grid using "NeedDataSource". But the grid is not able to render on the page load ,later if i press refresh, it is showing the data.

Product Version : 2008.01.0415.20.

Pradeep
Top achievements
Rank 1
 answered on 22 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?