I am having issues when using an edit template to create a new record. On insert, the same binding is assumed and does not work as there is nothng to bind to. For example, I have a date picker for which I have resricted the range from 2011 to 2050. On insert, there is no value being passed in and so an exception raised (Object cannot be cast from DBNull to other types.)
e.g.
<td>
<asp:CheckBox ID="Critical_E" runat="server" Text="Critical" Checked='<%# DataBinder.Eval( Container, "DataItem.Critical" ) %>' />
</td>
How do I either 1) disable the binding on insert, 2) create a separate insert template without having to create user controls?
Thanks,
Neil.
Protected Sub CustomerName_SelectedIndexChanged(ByVal o As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs) Dim editedItem As GridEditFormItem = DirectCast(rgOpportunities.MasterTableView.GetItems(GridItemType.EditFormItem)(0), GridEditFormItem) Dim CustomerCombo As RadComboBox = DirectCast(editedItem.FindControl("rcbCustomerName"), RadComboBox) Dim ContactsCombo As RadComboBox = DirectCast(editedItem.FindControl("rcbContactName"), RadComboBox) If (CustomerCombo.DataSourceID IsNot Nothing) Then CustomerCombo.DataSourceID = String.Empty End If ContactsCombo.DataSource = LoadContacts(e.Value) 'ContactsCombo.Items.Clear() ContactsCombo.OpenDropDownOnLoad() = True ContactsCombo.DataBind() If ContactsCombo.Items.Count > 0 Then Session("ContactID") = ContactsCombo.Items(0).Value Else Session("ContactID") = "" End If End Sub<telerik:RadGrid runat="server" ID="RadGrid1" AllowMultiRowSelection="true" AllowMultiRowEdit="true" EnableViewState="true" ViewStateMode="Enabled"><MasterTableView DataKeyNames="ProgramPhoneListId, ProgramId, IsPrimary, AliasName, PhoneNumber, Extension, PhoneTypeValuesId" ClientDataKeyNames="ProgramPhoneListId, ProgramId, IsPrimary, AliasName, PhoneNumber, Extension, PhoneTypeValuesId" NoMasterRecordsText="Please click the 'Add' button to add a phone number..." EditMode="InPlace" AutoGenerateColumns="true" TableLayout="Fixed"><Columns><telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" CommandName="Select" /></Columns></MasterTableView><ClientSettings EnableRowHoverStyle="true"><Selecting AllowRowSelect="true" /><Scrolling AllowScroll="true" UseStaticHeaders="true" /></ClientSettings></telerik:RadGrid>
|
Page.Master.Page.Form.DefaultButton = btnEnter.UniqueID;
I entered some text on policy id and click on enter button,it should bind mygrid which is in ajaxpanel.
when i click on enter button,it is firing the event..but it is unable to find the radgrid.
<telerik:RadAjaxPanel ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" runat="server">
//My Grid....
</telerik:RadAjaxPanel>
I have more than one textboxes and if i entered text on any one of the textbox and click on enter button,i shouldget the grid with the latest result..
i tried all forum thread solutions..
can u please provide new one..ASAP..
Thanks,
PANDU
<
telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" RelativeTo="Element" Animation="None" OnAjaxUpdate="OnAjaxUpdate" AutoCloseDelay="2000" HideDelay="0" ShowCallout="false" Position="MiddleRight" ShowDelay="0" ContentScrolling="Auto" ShowEvent="OnMouseOver" Visible="true" Style="display: none;">
</telerik:RadToolTipManager>
<
telerik:RadGrid ID="RadGridMain" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnItemEvent="RadGridMain_ItemEvent" OnNeedDataSource="RadGridMain_NeedDataSource" OnItemDataBound="RadGridMain_ItemDataBound">
<MasterTableView>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Resizable="False" Visible="False">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn UniqueName="Detail">
<ItemTemplate>
<sis:WebButton ID="WebButtonDetail" runat="server" ImageUrl="~/App_Themes/LBL/wbtnDetail_small.gif" IsSmallButton="true" UseCssHover="true" AutoTipKey="Detail" OnCommand="WebButtonDetail_OnCommand" CommandArgument='<%# Eval("StudentDBN") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Photo" UniqueName="Photo">
<ItemTemplate>
<sis:WebButton ID="WebButtonCamera" runat="server" ImageUrl="~/App_Themes/LBL/wbtnCamera.gif" UseCssHover="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
C# Code :
protected
void Page_Load( object sender, EventArgs e ) {
if
( Page.IsPostBack == false ) {
this.RadToolTipManager1.TargetControls.Clear();
}
protected
void RadGridMain_ItemDataBound( object sender, GridItemEventArgs e ) {
if
( e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item ) {
WebButton
photoBtn = e.Item.Cells[3].FindControlRecursive<WebButton>();
if
(photoBtn != null){
photoBtn.Visible = btnVisible;
if (btnVisible)
{
photoBtn.ID = sum.StudentDBN +
".jpg";
this.RadToolTipManager1.TargetControls.Add(photoBtn.ClientID, true);
} } }
protected
void OnAjaxUpdate( object sender, ToolTipUpdateEventArgs args ) {
int start = args.TargetControlID.LastIndexOf( "_" );
string im = args.TargetControlID.Substring( start + 1 );
Image image = new Image();
image.ImageUrl = im;
image.ImageUrl =
"Images/GetImage.ashx?s=" + im;
if ( image.Height.Value > 200 ) {
image.Height = 200;
}
args.UpdatePanel.ContentTemplateContainer.Controls.Add( image );
int index = args.TargetControlID.LastIndexOf( "_" );
string elementID = args.TargetControlID.Substring( index + 1 );
this.UpdateToolTip( elementID, args.UpdatePanel );
}
private void UpdateToolTip( string elementID, UpdatePanel panel ) {
Control ctrl = Page.LoadControl( "Controls/StudentPhotoPopup.ascx" );
panel.ContentTemplateContainer.Controls.Add( ctrl );
//
}
Thanks,
Brenda

Hello,
I'm testing the controls and I found that the RadComboBox, when the state is Disabled, in chrome with the skin of Windows7, the selected item is not visible.
I could indicate how this problem is solved.
Thank you,
Sorry for my English.