<telerik:RadGrid ID="ContactsGrid" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" AllowSorting="True" Culture="de-DE" DataSourceID="contacts" GridLines="None" Height="100%" OnItemCreated="ContactsGrid_ItemCreated" OnItemInserted="ContactsGrid_ItemInserted" OnPreRender="ContactsGrid_PreRender" onneeddatasource="ContactsGrid_NeedDataSource" onitemdatabound="ContactsGrid_ItemDataBound"> <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="ContactsID" DataSourceID="contacts" InsertItemPageIndexAction="ShowItemOnCurrentPage"> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> </telerik:GridEditCommandColumn> <telerik:GridBoundColumn DataField="ContactsID" DataType="System.Int32" FilterControlAltText="Filter ContactsID column" HeaderText="ContactsID" SortExpression="ContactsID" UniqueName="ContactsID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CustomerID" DataType="System.Int32" FilterControlAltText="Filter CustomerID column" HeaderText="CustomerID" SortExpression="CustomerID" UniqueName="CustomerID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Name" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Lastname" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Lastname column" HeaderText="Lastname" SortExpression="Lastname" UniqueName="Lastname"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Telephone" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Telephone column" HeaderText="Telephone" SortExpression="Telephone" UniqueName="Telephone"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Mobile" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Mobile column" HeaderText="Mobile" SortExpression="Mobile" UniqueName="Mobile" AutoPostBackOnFilter="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="E_Mail" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter E_Mail column" HeaderText="E_Mail" SortExpression="E_Mail" UniqueName="E_Mail"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Fax" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Fax column" HeaderText="Fax" SortExpression="Fax" UniqueName="Fax"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Department" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Department column" HeaderText="Department" SortExpression="Department" UniqueName="Department"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Notification" DataFormatString="<nobr>{0}</nobr>" FilterControlAltText="Filter Notification column" HeaderText="Notification" SortExpression="Notification" UniqueName="Notification"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete" /> </Columns> <EditFormSettings> <EditColumn ButtonType="ImageButton" /> </EditFormSettings> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="True"></Selecting> </ClientSettings> </telerik:RadGrid>ContactsGrid.MasterTableView.FilterExpression = "it.CustomerID = " + e.Index;ContactsGrid.MasterTableView.Rebind();// Create a RadPnaleItem and set the Text to SelectionTitle.RadPanelItem radPanelItemSelection = new RadPanelItem();radPanelItemSelection.Text = row["SelectionTitle"].ToString();// Expand only the first selection.if (selectionNumber == 1){ radPanelItemSelection.Expanded = true;}else{ radPanelItemSelection.Expanded = false;}// Create anothet RadPanelItem and add the CheckBoxList.RadPanelItem radPanelItemCheckBoxList = new RadPanelItem();radPanelItemCheckBoxList.Controls.Add(checkBoxList);radPanelItemSelection.Items.Add(radPanelItemCheckBoxList);// Add the RadPanelItem to the RadPanelBar.rpbFilters.Items.Add(radPanelItemSelection);RadPanelItem radPanelItem = rpbFilters.Items[0];CheckBoxList checkBoxList = (CheckBoxList)radPanelItem.FindControl("cblSelect1");var radPanelItems = rpbFilters.GetAllItems();foreach (RadPanelItem item in radPanelItems){ RadPanelItem radPanelItem = item.Items[0]; CheckBoxList checkBoxList = (CheckBoxList)radPanelItem.FindControl("cblSelect1");}I'm getting an error "Conversion from type 'DBNull' to type 'Boolean' is not valid." upon displaying an insert form inside a RadGrid that has two RadButton controls with the ToggleType="Checkbox" that have the Checked property being bound from a database.
<telerik:RadButton ID="RXRequired" runat="server" ForeColor="White"
AutoPostBack="false" ButtonType="ToggleButton" Checked='<%# Bind("RXRequired")%>'
ToggleType="CheckBox" EnableViewState="true" >
<ToggleStates>
<telerik:RadButtonToggleState PrimaryIconCssClass="rbRemove" />
<telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" Selected="true" />
</ToggleStates>
</telerik:RadButton>
I have seen numerous posts all over the web regarding DBNull values and checkboxes upon initiating a form insert with the Bind statement. This apparently has been going on for many, many years. This is truly amazing that this is still an issue today, many years later! When the hell is Telerik going to fix this issue with their controls? Come on guys, fix this already!!! This is a real simple thing to do, why should this still be an issue?
This is insane already. FIX IT!!!!!!!!!!!!!!!!!!!!!!
Hi
i use Following code : (RadControls for ASP.NET Q3 2010)
var oWindow = window.radopen(navigateUrl, null);
oWindow.setSize(winWidth, winHeight);
oWindow.set_title(winTitle);
oWindow.add_pageLoad(function () { oWindow.set_status(" "); });
oWindow.center();
and config of RadWindowManager :
<telerik:RadWindowManager ID="RadWindowManager" runat="server"
Skin="Vista" Behavior="Close, Move, Resize, Minimize, Maximize, Reload"
OnClientClose="OnClientClose" Width="1280px" Height="1024px"
VisibleStatusbar="true" RestrictionZoneID="fullheightcontainer"
ShowContentDuringLoad="true" DestroyOnClose="true" MinimizeZoneID="MinimizeBar">
</telerik:RadWindowManager>
this code work correctly on IE but when i use it in firefox , oWindow.setSize doesn't work
and show all window in Width="1280px" Height="1024px" resolution!!!!
==============================================================================
also i have a question about following script :
// Get instance from Parent RadWindowManager
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
function ShowModalWindow(navigateUrl, winWidth, winHeight, winTitle, setModal) {
var oManager = GetRadWindow().get_windowManager();
var oWindow = oManager.open(navigateUrl, null);
// Set RadWindow Behaviors ClientSide
// Close, Move, Resize, Reload
oWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close +
Telerik.Web.UI.WindowBehaviors.Move +
Telerik.Web.UI.WindowBehaviors.Resize +
Telerik.Web.UI.WindowBehaviors.Reload);
oWindow.setSize(winWidth, winHeight);
oWindow.set_title(winTitle);
oWindow.add_pageLoad(function () { oWindow.set_status(" "); });
oWindow.center();
if (setModal == true) {
oWindow.set_modal(true);
}
return false;
};
when i using this code i have an error :
"Microsoft JScript runtime error: 'Telerik.Web.UI.WindowBehaviors.Close' is null or not an object" :-(
how can i fix it , please help me
really thanks