Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
126 views

Hello,

I am using a RadTimePicker template column in a radgrid (both are RadControls for ASP.NET Q2 2008). I initialized StartTime and EndTime for the time pickers, but it does not take effect in the client side - the picker still displays time range from 12:00AM to 23:30. Here is the ASP page (there is only one radgrid control on the page):

<rad:radgrid id="gdActivityTime" runat="server" skin="Office2007" Autogeneratecolumns="false" width="95%">

         <MasterTableView DataKeyNames="ActivityNodeID" ShowHeader="false">
         <Columns>

        <rad:GridBoundColumn DataField="ActivityName" HeaderText="Activity"></rad:GridBoundColumn>

        <rad:GridTemplateColumn>

            <ItemTemplate>
                   <rad:RadTimePicker AutoPostBack="true" ID="pkDesignatedStartTime" runat="server" Width="85px" >
                       <TimeView ID="TimeView1" runat="server"  Skin="" Interval="0:30">
                       </TimeView>
                       <PopupButton Visible="False" />
                       <DatePopupButton Visible="False" />
                       <DateInput Skin="" />
                  </rad:RadTimePicker>
           </ItemTemplate>
       </rad:GridTemplateColumn>
    </Columns>
 
</MasterTableView>
</rad:radgrid>

Here is the code behind:

//generate 10 rows:
DataTable tblActTime = new DataTable();
tblActTime.Columns.Add(new DataColumn("ActivityName", typeof(string)));
tblActTime.Columns.Add(new DataColumn("DesignatedStartTime", typeof(TimeSpan)));
tblActTime.Columns.Add(new DataColumn("ActivityNodeID", typeof(string)));

for(int n=0; n<10; n++)
{
   DataRow dract = tblActTime.NewRow();
   dract["ActivityName"] = string.Format("Activity{0}", n);
   dract["ActivityNodeID"] = n;
   tblActTime.Rows.Add(dract);
}

gdActivityTime.DataSource = tblActTime;
gdActivityTime.DataBind();

//initialize start/end time for all time picker in the grid:

TimeSpan dtStart = new TimeSpan(0, 8, 0);
TimeSpan dtEnd = new TimeSpan(0, 21, 0);

foreach (GridDataItem pkgItem in gdActivityTime.MasterTableView.Items)
{
    DataRowView drx = pkgItem.DataItem as DataRowView;
    RadTimePicker dp = pkgItem.FindControl("pkDesignatedStartTime") as RadTimePicker;
    dp.TimeView.StartTime = dtStart;
    dp.TimeView.EndTime = dtEnd;
}

Thank you in advance.

 

Pavel
Telerik team
 answered on 09 Jan 2009
1 answer
106 views

We are using treeview under the RadComboBox. Some nodes are disable in treeview. Now when user try to select disable node in treeview then we are not allowing user to select node and cancelling the event at client site using this  args.set_cancel(true) under this event OnClientNodeClicking.

After that we like to keep displaying previous selected node text value in combobox text because new node selection is invalid due to disable node.

  Now our problem is that after the post back in first client site event combo box doesn't able to show valid selected node value it shows value of all node text. after that from 2nd client side event onwards it works properly and started showing only selected node value and igonring disable node value in combo box.

  Here is the code which we have writtren OnClientNodClicking.

 

 

 

function nodeClicking1(sender, args)  

 

var comboBox = $find("<%= RadComboBox2.ClientID %>");  

 

var node = args.get_node();  

 

var parentnode = node.get_parent();  

 

var tree = comboBox.get_items().getItem(0).findControl("RadTreeView3"); 

 

var selectedNode = tree.get_selectedNode(); 

 

 

 

var selectedtext = selectedNode.get_text();

 

 

 

 

 

if (parentnode != null && node.get_enabled())  

{

 

 

comboBox.set_text(node.get_text());

 

 

comboBox.trackChanges();

comboBox.get_items().getItem(0).set_value(node.get_text());

comboBox.set_text(node.get_text());

comboBox.commitChanges();

comboBox.hideDropDown();

 

}

 

 

 

 

else

 

{

        args.set_cancel(

true);

 

     

 

 

     //keep showing previous enable node value and igoner disable node value

 

     

comboBox.set_text(selectedtext);
     comboBox.trackChanges();
     comboBox.set_text(selectedtext);
      comboBox.commitChanges();
     comboBox.showDropDown();
 }

 

 

 

}

 

 

Yana
Telerik team
 answered on 09 Jan 2009
1 answer
160 views
Hi,
I have this Grid + Label on ASCX file:
<asp:Label runat="server" ID="hdnPId" Text="1"></asp:Label> 
 
 
<telerik:RadGrid ID="RadGrid1" Skin="Vista" Width="97%" runat="server" ShowFooter="True" 
    PageSize="7" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" 
    OnItemDataBound="RadGrid1_ItemDataBound" GridLines="None" DataSourceID="CaptureDataSource" 
    ValidationSettings-EnableValidation="true" ValidationSettings-ValidationGroup="ConfigConfigValidationGroup"
    <HeaderContextMenu Skin="Vista" EnableTheming="True"
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
    </HeaderContextMenu> 
    <PagerStyle Mode="NextPrevAndNumeric" /> 
    <MasterTableView Width="100%" GridLines="None" CommandItemDisplay="Top" EditMode="InPlace" 
        AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" 
        HorizontalAlign="NotSet" AutoGenerateColumns="False" DataKeyNames="iCaptureId" 
        DataSourceID="CaptureDataSource"
        <CommandItemTemplate> 
            <div style="padding: 0 5px;"
                <asp:LinkButton ValidationGroup="ConfigConfigValidationGroup" ID="btnCancel" runat="server" 
                    CommandName="CancelAll" CausesValidation="false" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="./Img/Cancel.gif" />Cancel</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ValidationGroup="ConfigConfigValidationGroup" ID="Add" runat="server" 
                    CommandName="InitInsert" CausesValidation="false" Enabled='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="/Img/AddRecord.gif" />Add Capture</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ValidationGroup="ConfigConfigValidationGroup" ID="LinkButton1" CausesValidation="false" 
                    OnClientClick="javascript:return confirm('Delete Selected Capture?')" runat="server" 
                    CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="/Img/Delete.gif" />Delete</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="LinkButton3" ValidationGroup="ConfigConfigValidationGroup" runat="server" 
                    CausesValidation="false" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'>Add this Customer</asp:LinkButton>&nbsp;&nbsp; 
            </div> 
            <%-- <div style="padding: 0 5px;"
                Custom command item template&nbsp;&nbsp;&nbsp;&nbsp; 
                <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'>Edit selected</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'>Update</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'>Cancel editing</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'>Add new</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'>Add this Customer</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')" 
                    runat="server" CommandName="DeleteSelected">Delete selected customers</asp:LinkButton>&nbsp;&nbsp; 
                <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid">Refresh customer list</asp:LinkButton> 
            </div>--%> 
        </CommandItemTemplate> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="..\Img\Update.gif" 
                EditImageUrl="..\Img\Edit.gif" InsertImageUrl="..\Img\Insert.gif" CancelImageUrl="..\Img\Cancel.gif"
            </telerik:GridEditCommandColumn> 
            <telerik:GridBoundColumn DataField="iCaptureId" DataType="System.Int32" HeaderText="iCaptureId" 
                ReadOnly="True" SortExpression="iCaptureId" UniqueName="iCaptureId"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="iPackageId" DataType="System.Int32" HeaderText="iPackageId" 
                SortExpression="iPackageId" UniqueName="iPackageId"
            </telerik:GridBoundColumn> 
            <telerik:GridDropDownColumn DataField="iCaptureType" HeaderText="iCaptureType" SortExpression="iCaptureType" 
                UniqueName="iCaptureType" DataType="System.Int32" DropDownControlType="DropDownList"
            </telerik:GridDropDownColumn> 
            <telerik:GridBoundColumn DataField="nvcAlias" HeaderText="nvcAlias" SortExpression="nvcAlias" 
                UniqueName="nvcAlias"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="nvcCtiTrunk" HeaderText="nvcCtiTrunk" SortExpression="nvcCtiTrunk" 
                UniqueName="nvcCtiTrunk"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="iBoardNumber" DataType="System.Int32" HeaderText="iBoardNumber" 
                SortExpression="iBoardNumber" UniqueName="iBoardNumber"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="iBoardTrunk" DataType="System.Int32" HeaderText="iBoardTrunk" 
                SortExpression="iBoardTrunk" UniqueName="iBoardTrunk"
            </telerik:GridBoundColumn> 
            <telerik:GridDropDownColumn DataField="nvcFrameFormat" HeaderText="nvcFrameFormat" 
                DropDownControlType="DropDownList" SortExpression="nvcFrameFormat" UniqueName="nvcFrameFormat"
            </telerik:GridDropDownColumn> 
            <telerik:GridDropDownColumn DataField="bitSummed" HeaderText="bitSummed" SortExpression="bitSummed" 
                UniqueName="bitSummed" DropDownControlType="DropDownList"
            </telerik:GridDropDownColumn> 
            <telerik:GridBoundColumn DataField="iNumOfChannels" HeaderText="iNumOfChannels" SortExpression="iNumOfChannels" 
                UniqueName="iNumOfChannels" DataType="System.Int32"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="iUsedChannels" DataType="System.Int32" HeaderText="iUsedChannels" 
                SortExpression="iUsedChannels" UniqueName="iUsedChannels"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="nvcFirstTimeSlot" HeaderText="nvcFirstTimeSlot" 
                SortExpression="nvcFirstTimeSlot" UniqueName="nvcFirstTimeSlot"
            </telerik:GridBoundColumn> 
        </Columns> 
        <EditFormSettings CaptionDataField="iCaptureId"
            <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle> 
            <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle> 
            <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle> 
            <EditColumn ButtonType="ImageButton" /> 
        </EditFormSettings> 
    </MasterTableView> 
    <ClientSettings> 
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" /> 
    </ClientSettings> 
    <FilterMenu Skin="Vista" EnableTheming="True"
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
    </FilterMenu> 
</telerik:RadGrid> 
<asp:ObjectDataSource ID="CaptureDataSource" runat="server" DeleteMethod="Delete" 
    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="Fill" 
    TypeName="NPEWebApplication.Configurations.RecordingConfiguration.ConfigControls.CaptureDataSource" 
    UpdateMethod="Update"
    <DeleteParameters> 
        <asp:Parameter Name="iCaptureId" Type="String" /> 
        <asp:Parameter Name="original_iCaptureId" Type="Int32" /> 
    </DeleteParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="nvcFrameFormat" Type="String" /> 
        <asp:Parameter Name="iUsedChannels" Type="Int32" /> 
        <asp:Parameter Name="iBoardNumber" Type="Int32" /> 
        <asp:Parameter Name="iNumOfChannels" Type="Int32" /> 
        <asp:Parameter Name="nvcAlias" Type="String" /> 
        <asp:Parameter Name="nvcFirstTimeSlot" Type="String" /> 
        <asp:Parameter Name="iPackageId" Type="Int32" /> 
        <asp:ControlParameter ControlID="txtCaptureType" Name="iCaptureType" Type="Int32" 
            PropertyName="Text" /> 
        <asp:Parameter Name="iBoardTrunk" Type="Int32" /> 
        <asp:Parameter Name="bitSummed" Type="String" /> 
        <asp:Parameter Name="nvcCtiTrunk" Type="String" /> 
        <asp:Parameter Name="original_iCaptureId" Type="Int32" /> 
    </UpdateParameters> 
    <SelectParameters> 
        <asp:ControlParameter ControlID="hdnPId" Name="iPackageId" PropertyName="Text" 
            Type="Int32" /> 
    </SelectParameters> 
    <InsertParameters> 
        <asp:Parameter Name="nvcFrameFormat" Type="String" /> 
        <asp:Parameter Name="iUsedChannels" Type="Int32" /> 
        <asp:Parameter Name="iBoardNumber" Type="Int32" /> 
        <asp:Parameter Name="iNumOfChannels" Type="Int32" /> 
        <asp:Parameter Name="nvcAlias" Type="String" /> 
        <asp:Parameter Name="nvcFirstTimeSlot" Type="String" /> 
        <asp:ControlParameter ControlID="hdnPId" Name="iPackageId" PropertyName="Text" 
            Type="Int32" /> 
        <asp:ControlParameter ControlID="txtCaptureType" Name="iCaptureType" Type="Int32" 
            PropertyName="Text" /> 
        <asp:Parameter Name="iBoardTrunk" Type="Int32" /> 
        <asp:Parameter Name="bitSummed" Type="String" /> 
        <asp:Parameter Name="nvcCtiTrunk" Type="String" /> 
    </InsertParameters> 
</asp:ObjectDataSource> 


I define my own object datasource. When I debug the Fill method, I can see that iPackageId is 1. Nothing changes it, but when I insert a new record, the Insert method on my objectdatasource recivies iPackageId as 0. why?
Rosen
Telerik team
 answered on 09 Jan 2009
1 answer
67 views
Whether as to me to learn the certain element in grid on the selected page and with current customisations of filters is displayed?
And how to me to learn on what page of the table, at current sorting and current filters, to be a element?
Thanks!
Yavor
Telerik team
 answered on 09 Jan 2009
2 answers
101 views
Hi
   I am Not get the "+ " and "-" sign images in front of the Rad tree which is placed inside the Rad combobox. But the content is displayed in tree structure without "+ and "-" images.

In the client side  I am implementing this code:

<telerik:RadComboBox ID="RadCmbContent" runat="server" OnClientBlur="NodeLoad"  EnableTheming ="true" Width="250px" Height="160px"  ShowToggleImage="True">
                                                <ItemTemplate>  
                                                    <div id="div1" class="DropDownTreeViewDiv">   
                                                        <telerik:RadTreeView ID="ObjectFolder" runat="server" Width="230px"  EnableEmbeddedSkins="False"
                                                            OnClientNodeClicking="nodeClicking" >   
                                                        </telerik:RadTreeView>  
                                                    </div>  
                                                </ItemTemplate>  
                                                <Items>  
                                                      <telerik:RadComboBoxItem Text="" ParentID='<%# Eval("StructureId") %>' />
                                                </Items>
                                                <CollapseAnimation Duration="200" Type="OutQuint" />  
                                                <ExpandAnimation Type="OutQuart" />
                                            </telerik:RadComboBox><br /><br />
                                            <script type="text/javascript">   
                                                var div1 = document.getElementById("div1");   
                                                div1.onclick = StopPropagation;   
                                            </script>

In the sever side :

 On page load event:

 Dim ObjectFolder As RadTreeView = Nothing
        For Each myItem As RadComboBoxItem In RadCmbContent.Items
            ObjectFolder = DirectCast(myItem.FindControl("ObjectFolder"), RadTreeView)
            Exit For
        Next

       Dim rootNode As New RadTreeNode
        Dim Parentid As String
        Dim checkMenuType As String
        If MenuType.WebFolders = menutypes Then
            SqlString = "select [ParentID]  FROM " & ClientName & ".[dbo].[Structure] where [StructureID]=" & Structid
            Parentid = oDb.ExecuteScaler(SqlString)
            SqlString = "select [MenuType] FROM " & ClientName & ".[dbo].[Structure] where [StructureID]=" & Parentid
            checkMenuType = oDb.ExecuteScaler(SqlString)
            'rootNode.Text = "---------Select----------"
            If checkMenuType = MenuType.Websites Then
                rootNode.Text = NodeName
                rootNode.ToolTip = NodeName
                rootNode.Value = Structid
                rootNode.ExpandMode = TreeNodeExpandMode.ServerSide
                ObjectFolder.Nodes.Add(rootNode)
                LoadClientNode(rootNode)
            End If
End if


The above one is the parent Node. Is there any property I have to set for this ...
Help me...



nallamani
Top achievements
Rank 1
 answered on 09 Jan 2009
1 answer
114 views
Is there a way to wrap the text or atleast increase the font size of the textbox used to edit the node text?  I tried using the rtEdit css class and style attributes for input control but it did not resolve the issue. I will greatly appreciate your help.
Yana
Telerik team
 answered on 09 Jan 2009
15 answers
199 views
I have a page which opens two radwindows, and in both of them the menu bar icons do not display in IE6. They are still there because you can click where they should be and the page closes etc.. but you cannot see them. In IE7 they display perfectly.
Is this a common problem or something you've seen before?

Should I change anything in the following code:

    <script language="javascript" type="text/javascript">  
        <!--  
function openWin()  
        {     
            var o = $get('ctl00$ContentMain$hdnIDPGUID');  
            if(null != o)  
            {  
                var oWnd = radopen("IDPHistory.aspx?GUID=" + o.value, "RadWindow1");  
                oWnd.RestrictionZoneID = "divbody";  
            }  
        }  
        function openMailWin(mailid, idpguid, dnguid)  
        {  
            var oWnd = radopen('IDPMail.aspx?MailID=' + mailid + '&idpguid=' + idpguid + '&dnguid=' + dnguid, "RadWindowEmail");  
              
            oWnd.add_close(OnClientClose);  
        }  
 
        function closeWindow()  
        {     
            var currentWindow = GetRadWindow();  
        }  
 
           
        //--> 
    </script> 
 
 
    <telerik:RadWindowManager VisibleStatusbar="false" Skin="WebBlue" Width="550" Height="650" DestroyOnClose="true" KeepInScreenBounds="true" ID="RadWindowManager1" runat="server"  Behaviors="Minimize, Move, Close, Pin, Reload" RestrictionZoneID="divbody">  
    </telerik:RadWindowManager> 
     
Martin
Telerik team
 answered on 09 Jan 2009
1 answer
354 views
I too have run into this error:

DataBinding: 'Telerik.WebControls.GridInsertionObject' does not contain a property with the name 'subject'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinding: 'Telerik.WebControls.GridInsertionObject' does not contain a property with the name 'subject'.

The error results from initiating an insert from a grid that has no rows/records.  If the grid has existing records, the insert works fine.

What I found, in my case, is a simple fix to the problem.  My SqlData Source was:

<asp:SqlDataSource ID="dsParent" runat="server" DataSourceMode="DataReader"></asp:SqlDataSource>

The problem disappeared by removing the DataSourceMode property thus:

<asp:SqlDataSource ID="dsParent" runat="server"></asp:SqlDataSource> 

I hope this will help someone down the line who runs into this problem again.  This may not solve everyones problem with this error message, but it fixed mine.  Happy coding!

Shinu
Top achievements
Rank 2
 answered on 09 Jan 2009
0 answers
90 views
Hi All

I'm verry confused, i'm sure what i am trying to do is very simple, however...not to me!!!

basicly, i have set up some databound tabs..which is fine... my problem is...how do i get content into each tab... at the moment all i have  is a bunch of data bound tab heddings with no content...exactly as (RADControlSamples/TabStrip/Examples/PopulatingWithData/DataBindings/)

how can i get DIFFERENT content into the Indevidual tabs?? 

any help would be great

thanks

Tom
odx
Top achievements
Rank 1
 asked on 09 Jan 2009
0 answers
142 views
I have an User Control and this UC contains a Telerik Tree View control that is nested inside a Panel. Now i put this UC in a webpartzone.Everything work fine but when i close this webpart i got this error at runtime.

VS throws a null exception error:
Microsoft JScript runtime error: 'null' is null or not an object

This is the code where the exception is thrown (line indicated) :

Telerik.Web.UI.RadTreeView._preInitialize=function(_219,_21a){
var _21b=$get(_219);
_21b.scrollTop=_21a; <-- Error
if(Telerik.Web.UI.RadTreeView._isRtl(_21b)){
Telerik.Web.UI.RadTreeView._initializeRtl(_21b);
}
};

Please suggest
Kailash
Top achievements
Rank 1
 asked on 09 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?