Hello, I have a RadGrid with an EditFormType set to 'Template'. I can't figure out how to access form elements inside this FormTemplate from the code behind. I'm trying to make one drop down change its options when another one is selected.
When I try to compile this code, it tells me "The name 'drpEditTarget' does not exists in the current context.". If I move that drop-down outside of the RadGrid, it's suddenly accessible again. I guess my two questions are...
--1) How can I access this element from the code behind?
--2) What's the difference between elements outside and inside the Grid? Why can I access the former but not the latter? (the answer to this might be a more broad asp.net question)
Default.aspx
<Telerik:RadGrid ID="RequestsGrid"runat="server" OnNeedDataSource="RequestsGrid_NeedDataSource" OnCancelCommand="RequestGrid_CancelCommand" OnDeleteCommand="RequestsGrid_DeleteCommand" OnItemCommand="RequestGrid_ItemCommand" OnItemDataBound="RequestsGrid_ItemDataBound" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="true" DataSourceID="requests"> <MasterTableView AutoGenerateColumns="false" DataKeyNames="id,requester,output,notes" DataSourceID="requests" CommandItemDisplay="Bottom"> <EditFormSettings EditFormType="Template"> <EditColumn UniqueName="EditColumn"></EditColumn> <FormTemplate> <b>First Target:</b> <asp:DropDownList runat="server" SelectedValue='<%# Eval("target") %>' ID="drpEditTarget" AutoPostBack="true" DataSource='<%# getPossibleTargets( (string)Eval("output") ) %>' OnSelectedIndexChanged="drpEditTarget_SelectedIndexChanged"></asp:DropDownList> <b>Second Target:</b></td> <asp:DropDownList runat="server" ID="drpEditSecondTarget"></asp:DropDownList> <asp:Button ID="btnUpdate" CommandName="Update" Text="Update" runat="server" /> <asp:Button ID="btnCancel" CommandName="Cancel" Text="Cancel" runat="server" /> </FormTemplate> </EditFormSettings> <Columns> <telerik:GridEditCommandColumn UniqueName="EditButton" Visible="false" ItemStyle-CssClass="skinny"/> <telerik:GridButtonColumn Text="Delete" UniqueName="DeleteButton" CommandName="Delete"></telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="id" HeaderText="ID" UniqueName="id"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="requester" HeaderText="Requester" UniqueName="requester"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="output" HeaderText="Output" UniqueName="output"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="notes" HeaderText="Notes" UniqueName="notes"></telerik:GridBoundColumn> <telerik:GridButtonColumn Text="Approve" UniqueName="ApproveButton" CommandName="Approve"></telerik:GridButtonColumn> <telerik:GridButtonColumn Text="Deny" UniqueName="DenyButton" CommandName="Deny"></telerik:GridButtonColumn> </Columns> </MasterTableView></Telerik:RadGrid>public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { populateGrid(); if (!Page.IsPostBack) { setFilterOptions(); RequestsGrid.Rebind(); } } protected void drpEditTarget_SelectedIndexChanged(object sender, EventArgs e) { drpEditSecondTarget.DataSource = getPossibleDestinations( drpEditTarget.SelectedValue.ToString() ); drpEditSecondTarget.DataBind(); }}<telerik:RadGrid runat="server" ID="FileListView" AutoGenerateColumns="false" Skin="Windows7"
Width="100%" OnDeleteCommand="FileListView_DeleteCommand">
<MasterTableView>
<Columns>
<telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete"
ConfirmTitle="Confirm" ConfirmText="Continue deleting file?" /> <telerik:GridBoundColumn UniqueName="file" DataField="file" Visible="false" ReadOnly="true" /><telerik:GridBoundColumn UniqueName="Attachedfiles" DataField="Attached files" HeaderText="File" />
<telerik:GridBoundColumn UniqueName="Attachedby" DataField="Editor" HeaderText="Attached by" />
<telerik:GridBoundColumn UniqueName="Attachedat" DataField="Modified" HeaderText="Attached at" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
protected void FileListView_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
string filename = editedItem["file"].Text;
logic continues...
but in the above code filename has   as the value. means filename contains empty space as it value instead of actual file name
Please suggest.
1.<telerik:RadComboBox ID="RadCombox1" runat="server" >2. <Items>3. <telerik:RadComboBoxItem Text="Aba" Value="1" />4. <telerik:RadComboBoxItem Text="Enugu" Value="2" />5. </Items>6. </telerik:RadComboBox>7. 8. var badRad = $find("<%= RadCombox1.ClientID %>");
2) Changing Screen resolution:
How to change the Screen resolution to 1024x768 only when I am within a Website using Telerik controls? Can this changes be done in a Master page so that changes reflects to all Content Pages? We are building a local Web Intranet project for our employees (Internal Users). I do not want to change users Screen resolution permanently Via Display Properties setting from Windows.
3) Maximize the Page:
How to Maximize the Page (not Full Screen) after it opens? Can this be done also via Master Page?
Anyhelp or suggestions will be sincerely appreciated.
Thank you.