Find Control In CommandItemTemplate For RadGrid?

Sep 9, 2010

I'm using RadGrid from Telerik with three LinkButton controls in CommandItem , and i want to hide or show them using switch statement at code behind.

<CommandItemTemplate>
<LinkButton runat="server" ID="approveAllLink" Text="Approve All" >
</LinkButton>
<LinkButton runat="server" ID="approveLink" Text="Approve" >
</LinkButton>
<LinkButton runat="server" ID="rejectLink" Text="Reject" >
</LinkButton>
</CommandItemTemplate>



ADVERTISEMENT

Find Html Anchor Control In Telerik:radgrid ?

Sep 22, 2010

how to find html anchor control in telerik:radgrid ?

View 1 Replies View Related

Add An Image To The Control Collection Of The Header Of RadGrid?

Aug 27, 2010

I would like to add and Image along with the HeaderText in RadGrid. I can able to do this in ItemBound event. But is there any possible ways to do the same in page prerender event?

View 2 Replies View Related

Javascript - Getting ClientID Of Control In RadGrid Edit Form

Aug 16, 2010

I have Telerik RadGrid with a custom edit form. In my edit form there is a RadDatePicker to which I have added a custom footer template containing a 'Today' button. In the OnClick event of the button I call a Javascript function which takes the control ID to set the selected date. However, because the control is inside the edit form there is no variable created for it and the compiler throws an error when I try getting the client ID. The RadDatePicker is declared with:

<telerik:RadDatePicker ID="ControlName" runat="server" SelectedDate='<%# Bind("Field") %>'>
<Calendar ID="Calendar1" runat="server">
<FooterTemplate>
<div style="width: 100%; text-align: center; background-color: Gray;">
<input id="Button1" type="button" value="Today" class="button"
onclick="GoToToday('<%= ControlName.ClientID %>')" />
</div>
</FooterTemplate>
</Calendar>
</telerik:RadDatePicker>

The error I get is CS0103: The name 'ControlName' does not exist in the current context on the line referencing the ClientID. Is there another way in which to get the ID to pass to the Javascript function?

View 3 Replies View Related

Web Forms :: Find Control In LoginView / Find The Controls In Code Behind?

Mar 8, 2011

I want to change the text of the user name text box which is inside a log in view on selected index chaged event of a drop down list.

this is my code:

[Code]....

but both ddl and tb are null

Anyone knows how can I find the controls in code behind?

View 1 Replies View Related

AJAX :: Control Canot Be Created Because Visual Studio Cannot Find The Control's Type In The Control?

Apr 15, 2010

i have problem in using ajax control , till morning it everything was file , now when i add any new ajax control it shows the error Control canot be created because visual studio cannot find the control's type in the control assembly then if i press OK it says The operation could not be completed . invalid FORMATETC structure

View 5 Replies View Related

Web Forms :: Find A Control Inside Nested Master Page And Another Control Container?

Dec 1, 2010

I'm trying to find a TextBox in the code-behind page, it's inside a nested master page and also then inside another control container (it's inside ctrlCheckoutShippingAddress also) .

I've tried this:

[Code]....

[Code]....

View 2 Replies View Related

Web Forms :: How To Find Textbox Control Inside DetailsView Control Using Javascript

Mar 23, 2010

how to find Textbox Control inside DetailsView Control Using Javascript, I tried below but gives an error OBject reference not found

document.getElementById('<%=DetailsView1.FindControl("TextBox1").ClientID%>');

View 3 Replies View Related

AJAX :: Reorderlist Control Item Template Dropdownlist Control Id Can't Find?

Nov 5, 2009

I got a QQ on AJAX Reorderlist Itemtemplate. I am using two reorderlist controls with in a page. Reorderlis1 contains pending records. I just load the pending records. the records can be moved from Reorderlist 1 to Reordrlist 2 with add button. In this table I am not doing reordering .

Reorderlist2 contains Queued records. In this I will do the reordering, the records which are there in Reorderlist 2 , transfer the records into the tasktable. In this table I have the cancel button also. If user don't want to update some records they can moved back those records from Recorder list 2 to Recorderlist 1. I am done with this part.

My 1st QQ:

Now I added Dropdownlist control to the Reorderlist 1 Item tamplate. Item template dropddownlist is my user control.My dropdown list contains the list of years. So I am calling my Usercontrol method with the Itrmtamplate dropdownlist ID. Here I got below error. 'ddlbeginyod1' is my Reorderlist Item template dropdownlist ID Text. Why?

Error:The name 'ddlbeginyod1' does not exist in the current context.

I tried adding the dropdownlist in insertitem template also. There also I got the same issue.

I never worked with Ajax Reorderlist control. I am very confused with this control.

I can add Dropdown list to the Reordrlist Itemtamplate right ? I

f I can add the dropdownlist into the item template I have 2nd QQ?

- If I can load the dropdownlist. For each row I will be having the year dropdownlist right. When user selects first row and moved from the reorderlist1 to reorderlist 2 with add button. he has to select the year of that row.

I need to send year value by each row to task table. Can I do that with reorderlist item template.How can I store the year value.If so, how can I do that? Please any one know the answer ,

I am coying my Reorderlist1 Code below,

[Code]....

View 2 Replies View Related

Forms Data Controls :: Testing A Control For A Null Value In Gridview - Find Control Problems?

Nov 24, 2009

I have a gridview containing template columns that have databound labels in them. I would like to check if one of the labels has a null value returned from the database, and if it has I would like to hide a different label in the row. (So in basic terms: If, in this row, Label A is Null Then Label B isn't visible.)

However, I can't find the controls in the gridview row to check the value as I would like. (I get object not set error). I'm using VB.

View 2 Replies View Related

Forms Data Controls :: How To Find Control Problem In Gridview While Adding Checkbox Control Dynamically

Mar 15, 2010

i have a gridview control i added checkbox contrl dynamically but i am not getiing the reference of checkbox in button clilck event here is my code Gridvew

[Code]....

.vb code

[Code]....

View 6 Replies View Related

Web Forms :: How To Find Control Inside User Control From Page

Nov 10, 2010

I have on dropdown that show hide user control. In the user control i have Ok and Cancel button.

When the dropdown change i want to apply ValidationGroup on the Ok button that is inside UserControl.

View 2 Replies View Related

Forms Data Controls :: How To Control Validation Does Not Find Control

Dec 8, 2009

Still can't find the control

Unable to find control id 'ctl00$ContentPlaceHolder1$GridView2$ctl02$TextBox1' referenced by the 'ControlToValidate' property of 'CustomValidator1'.

protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)

{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == DataControlRowState.Edit)
{
TextBox txtBox = (TextBox)e.Row.FindControl("TextBox1");
CustomValidator customValidator = new CustomValidator();
customValidator.ID = "CustomValidator1";
//customValidator.ControlToValidate = txtBox.ClientID;
customValidator.ControlToValidate = txtBox.UniqueID;
customValidator.ErrorMessage = "Please enter some text";
customValidator.SetFocusOnError = true;
customValidator.ValidateEmptyText = true;
customValidator.ClientValidationFunction = "jsFn-Textbox1";
e.Row.Cells[1].Controls.Add(customValidator);
}
}
}

//// as you can see Textbox1 does exist

<asp:GridView ID="GridView2" runat="server" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" DataSourceID="SqlDataSource4" ForeColor="#333333" GridLines="None"
Style="position: static" DataKeyNames="AutoItemDetailsRef,FKAutoOrderRef" Font-Names="Arial"
Font-Size="Small" OnRowDataBound="GridView2_RowDataBound">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="col_ItemRef" HeaderText="Item Ref" SortExpression="col_ItemRef" />
<asp:BoundField DataField="col_ItemDescription" HeaderText="Description" SortExpression="col_ItemDescription" />
<asp:TemplateField HeaderText="Item Price" SortExpression="col_ItemPrice">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("col_ItemPrice") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("col_ItemPrice", "{0:c}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity" SortExpression="col_ItemQuantity">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("col_ItemQuantity") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("col_ItemQuantity", "{0:f2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

View 5 Replies View Related

Web Forms :: How To Find Control For A GridView Inside Panel Control

Apr 23, 2010

I am developing a asp database that is linked with SQL Database. When I am tryind to Find Control (GridView2) inside of another control (Panel2) that sits in Item Template for DetailsView, I got an error message:

Object reference not set to an instance of an object.
<asp:DetailsView ID="DetailsView1" HeaderText="Details" HeaderStyle-CssClass="labelheadRight" runat="server" AutoGenerateRows="False" DataKeyNames="pk_BackupDriveSerial"
DataSourceID="SqlDataSource1" GridLines="None"
CssClass="Detailsview" AllowPaging="True"
OnDataBinding="DetailsView1_OnDataBind"
OnItemInserted="DetailsView1_OnInsert"
OnItemDeleted="DetailsView1_OnDelete"
>
<Fields>
<asp:BoundField DataField="pk_BackupDriveSerial" ControlStyle-CssClass="dropdownsize"
HeaderText="Serial No" ReadOnly="True"
SortExpression="pk_BackupDriveSerial" >
<ControlStyle CssClass="dropdownsize"></ControlStyle>
</asp:BoundField>
<asp:BoundField DataField="BackupDriveMake" HeaderText="Make" ControlStyle-CssClass="dropdownsize"
SortExpression="BackupDriveMake" >
<ControlStyle CssClass="dropdownsize"></ControlStyle>
</asp:BoundField>
<asp:BoundField DataField="BackupDriveModel" HeaderText="Model" ControlStyle-CssClass="dropdownsize"
SortExpression="BackupDriveModel" >
<ControlStyle CssClass="dropdownsize"></ControlStyle>
</asp:BoundField>
<asp:TemplateField HeaderText="Type" SortExpression="fkid_BackupDriveTypes" ControlStyle-CssClass="dropdownsize"
Visible="False">
<EditItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("BackupDriveMake") %>' Width="145px"></asp:Label>
<br />
<asp:TextBox CssClass="dropdownsize" AutoPostBack="true" ID="DropDownList5" runat="server" Text='<%# Bind("BackupDriveModel") %>' ></asp:TextBox>
<br />
<asp:Panel ID="Panel2" runat="server" CssClass="dropdownpanel" >
<asp:GridView CssClass="dropdowngrid" ID="GridView2" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="pkid_BackupDriveTypes" SelectedValue='<%# Bind("fkid_BackupDriveTypes") %>'
DataSourceID="SqlDataSource3" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView2_OnChange">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="pkid_BackupDriveTypes"
HeaderText="pkid_BackupDriveTypes" InsertVisible="False" ReadOnly="True"
SortExpression="pkid_BackupDriveTypes" Visible="False" />
<asp:BoundField DataField="BackupDriveMake" HeaderText="Make"
SortExpression="Make" />
<asp:BoundField DataField="BackupDriveModel" HeaderText="Model"
SortExpression="Model" />
<asp:CommandField ShowSelectButton="True" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</asp:Panel>
<asp:DropDownExtender ID="DropDownExtender2" runat="server" DropDownControlID="Panel2" TargetControlID="DropDownList5">
</asp:DropDownExtender>
</EditItemTemplate>

[Code]....

I also tried

[Code]....

View 5 Replies View Related

Security :: How To Find Control Inside Login View Control

Nov 17, 2010

may i know how to find control inside Login View Control

i m usng following way

HyperLink lnktest = (HyperLink)loginView.FindControl("test");

but its giving me error that lnktest is null i.e object reference is not set to instance of object

View 3 Replies View Related

AJAX :: How To Find A Control Which Is Specific To The User Control

Dec 1, 2009

I have created a user control where i implemented "ModalPopupExtender",which works fine when implement statically(drag and drop control on page).But am calling user control dynamically(Codebehind) and my page can have multiple instances of same user control.My question is how to find a control which is specific to the user control.

View 2 Replies View Related

C# - Add A RadGrid To A NestedViewTemplate?

Nov 17, 2010

I am currently using Visual Studio 2008 to develop a hierarchical grid that displays records, its got 3 levels. The code looks roughly like this.

<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false">
<telerik:RadPageView ID="RadPageView1" runat="server">
<telerik:RadGrid ID="radGrd1">
<MasterTableView>

[Code]....

I have ommited all the code and just provided the skeleton.

The problem i am having is that when i add the Radgrid, the intellisense does not seem to pick it up and visual studio does not add it to the designer class either.

I have tried viewing it in design view and forcing it to sync and even manually added it to the designer class myself. These solutions have not solved my problem as although the intellisense does pick up the control after adding it manually, the control itself is set to null during run time.

So basically is it possible to add a rad grid in the first place and if so what am i doing wrong.

View 1 Replies View Related

Unable To Find Control In Repeater Control?

Aug 23, 2010

This has got me stumped. I am trying to find a checkbox in a dynamically loaded asp.net Repeater template. The template works fine and the databinding is fine and everything displays fine but I can't find the control!

This is the repeater code (I have a similar one for the alternate template with a different style):

[Code].....

View 4 Replies View Related

Find Control Inside The DataList Control?

Jan 7, 2011

how i can find a DataList which is inside the DataList control? Its giving the Error Object not set to an Instance. i am finding the control this way :

DataList dl =((DataList) (DataList1.FindControl("DataList2")));

View 2 Replies View Related

C# - Find A Control Or Page A Control Is Embedded In?

Jan 9, 2011

I've written a web user control which I want to be able to drop into the markup for either aspx pages or other web user controls.I need my user control to be able to easily and efficiently work out if its inside another user control or an aspx page. My initial idea is to do it recursively with checks on the Parent property - continue looking up the nesting hierarchy until I find either a web form or a user control - but I'm not sure this the best way of going about this.

View 3 Replies View Related

Alternative To Telerik RadGrid?

Jan 14, 2011

Is anyone able to offer any decent alternatives to the telerik ASP.Net controls.

I'm in the market for a decent grid control with all singing all dancing extensions... bt I'm finding the telerik grid really hard work to deal with.

The telerik controls do look good, but after a day of hard work with them I'm just looking to see if there are any other 3rd party offerings?

View 3 Replies View Related

Telerik RadGrid - How To Add A New Row From Code Behind

Feb 5, 2010

What's the simplest way to add a new row to a Telerik RadGrid in ASP.NET from code behind?

View 2 Replies View Related

Only Allow One Edit Or Insert In A RadGrid?

Jul 22, 2010

I'm using the Telerik rad grid and I'm allow the user to enter data directly to the grid.

I am using the "EditForms" edit mode and I also allow inserts using the same.

If the user edits a row, then I don't want to allow any other edits or inserts until the current one is complete or cancelled.

View 1 Replies View Related

C# - Use OnMouseOver To Select A Radgrid Row?

Jun 9, 2010

I am currently highlighting a row in a radgrid using OnMouseOver. I would like to know if it is possible to use OnMouseOver to select the row rather than highlight it.

Alternatively, I would like the highlighted row to remain highlighted if the radgrid loses focus, such as when a confirmation box pops up.

View 2 Replies View Related

C# - Filtering On RadGrid Not Working?

Jan 15, 2010

I created a RadGrid with a couple of fields for filtering and I can't seem to get the filtering to work. I can see it clearly posting back (the ajax spinny circle thing) after typing something in the filter box, however my results are always the same. I am using the following definition in the aspx file:

<telerik:RadGrid PageSize="4" ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource"
OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" Skin="Black" ShowFooter="True"
ShowStatusBar="True" AllowFilteringByColumn="True"

[Code]....

View 2 Replies View Related

How To Display Data Using Radgrid Getting Error

Jun 11, 2010

When I am trying to display data using radgrid I am getting error like "Index was out of range. Must be non-negative and less than the size of the collection. Parameter: Index".

Here is my code

[Code]....

View 1 Replies View Related

Forms Data Controls :: Can't Get A Value From A RadGrid

Aug 23, 2010

All I want to do, is to get a values from a grid when it is not in edit mode. Note that I'm able to get two of the values (both the int32 fields), but I cannot get a reference to the "IsActive" Checkbox or the string "Delimiter" field.

let me know how I can accomplish this. Below is my code-behind. Notice the boldfaced fields I can't get...

[code]....

View 2 Replies View Related

C# - Any Pointers To How To Use Telerik RADGrid In C Sharp

Mar 24, 2011

give me any pointers for free tutorial on RADGRID or give me a simple example on how to create a RADGRID and bind it to data source.

View 2 Replies View Related

Finding Values In A Telerik Radgrid?

Nov 26, 2010

I've tried to find the answer, but am not having any luck and am wasting to much time trying to figure it out. Using RadGrid from Telerik, latest version of their Ajax Controls, I've added a Select to each row, and can't figure out how to get the value of the selected row. Prefer to get the value of the ID column (from ID field in my database) or other specific columns. C# or VB example will work, VB preferred.

View 2 Replies View Related

Iterate Over Rows/checkboxes In A RadGrid

Apr 5, 2010

I have a Telerik RadGrid with a GridTemplateColumn that contains a checkbox, as follows:

<telerik:GridTemplateColumn HeaderText="MINE" UniqueName="MyTemplateColumn">
<ItemTemplate>
<asp:CheckBox id="MyCheckBox" runat="server"></asp:CheckBox>
</ItemTemplate>
</telerik:GridTemplateColumn>

I want to set the box to be "checked" based on a value read from the database. I could handle the ItemDataBound event and read the database when each row is bound, but that results in n lookups. Instead, I want to handle DataBound, and then set all the values at once. So, in that method, I want code like this:

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved