Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
123 views
When I debug my code for editing/updating rows in the RadGrid, the following line of code:

DataRow[] changedRows = usersTable.Select(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["GUID"].ToString());

... throws the following error:

"from Syntax error: Missing operand after 'c93' operator."

The code is taken and adapted (very slightly) from the Update_Command() method in the code example here.

What does the error mean?

Also, can you suggest any other resources on the InPlace editing for RadGrid as I don't find the Telerik examples very clear (minimal code comments and description). I find the ordering of examples quite disjointed at times. From an ASP.NET point of view, I'm a beginner, so it could just be my inexperience!

Regards,
Anthony
Anthony
Top achievements
Rank 1
 answered on 27 Sep 2010
1 answer
124 views
When not using Templates in RadScheduler, you are provided default buttons for Save, Cancel and Options. If I want to add a custom control to the InlineInsertTemplate, I'm left having to add my own buttons to perform Save, Cancel and Options. Is there a way I can add my own custom controls (DropDownList etc) but still utilize the default Save, Cancel and Options buttons? As it is now, if I use a template, I'm left having to add by own buttons to perform these operations. 
Veronica
Telerik team
 answered on 27 Sep 2010
1 answer
113 views
hi
when i click on nextpage,firstpage,... not work
please help
thansk
Shinu
Top achievements
Rank 2
 answered on 27 Sep 2010
2 answers
79 views
Hello

I have a nested grid that works in crome but refuses to in ie8 .
I click on the dropdown arrow and the event doesnt fired.
No errors are shown
Please help!!

<telerik:RadGrid ID="ResellerGrid" ShowStatusBar="true" runat="server" AutoGenerateColumns="False"
       AllowSorting="True" AllowMultiRowSelection="True" AllowPaging="True" GridLines="None"
       OnDetailTableDataBind="ResellerGrid_DetailTableDataBind" OnNeedDataSource="ResellerGrid_NeedDataSource" OnPreRender="ResellerGrid_OnPreRender">
       <MasterTableView DataKeyNames="ResellerPriceId,ProductId" ShowFooter="true" AllowMultiColumnSorting="True"
           HierarchyDefaultExpanded="False">
           <DetailTables>
               <telerik:GridTableView DataKeyNames="ProductId" Width="100%" runat="server">
                  <ParentTableRelation>
                       <telerik:GridRelationFields DetailKeyField="ResellerPriceId" MasterKeyField="ResellerPriceId" />
                   </ParentTableRelation>
                   <NoRecordsTemplate>
                       No data</NoRecordsTemplate>
                   <Columns>                      
                         <telerik:GridTemplateColumn UniqueName="ProductNameTemplateColumn" HeaderText="Product Name">
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblProductName" Text='<%#Eval("ProductName") %>'/>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="chkScaledTemplateColumn" HeaderText="Is Scaled">
                           <ItemTemplate>
                               <asp:CheckBox runat="server" ID="chkScaled" OnCheckedChanged="chkScaled_OnCheckedChanged" Checked='<%#Eval("IsScaled") %>' AutoPostBack="true"/>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn UniqueName="txtCostTemplateColumn" HeaderText="Cost Price">
                           <ItemTemplate>
                               <asp:TextBox runat="server" ID="txtCost" Text='<%#ToCurrency(Eval("CostPrice")) %>' />
                           </ItemTemplate>                           
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn UniqueName="txtMarkUpTemplateColumn" HeaderText="MarkUp">
                           <ItemTemplate>
                               <asp:TextBox runat="server" ID="txtMarkUp" Width="100px" OnTextChanged="txtMarkUp_OnLeave" Text='<%#Eval("MarkUp") %>' AutoPostBack="true" />%
                                <asp:RegularExpressionValidator ID="regMarkUp" ControlToValidate="txtMarkUp"
                      ErrorMessage="Incorrect Percentage" runat="server" ValidationExpression='<%$ Resources:ValidationPatterns, Decimal %>'>[Invalid]</asp:RegularExpressionValidator>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn UniqueName="txtFinalCostTemplateColumn" HeaderText="Final Cost">
                           <ItemTemplate>
                               <asp:TextBox runat="server" ID="txtFinalCost" OnTextChanged="txtFinalCost_OnLeave" Text='<%#ToCurrency(Eval("FinalPrice")) %>' Align="Right" AutoPostBack="true"/>
                            <asp:RegularExpressionValidator ID="regFinalCost" ControlToValidate="txtFinalCost"
                      ErrorMessage="Incorrect Final Price" runat="server" ValidationExpression='<%$ Resources:ValidationPatterns,Decimal  %>'>[Invalid]</asp:RegularExpressionValidator>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>                       
                       <telerik:GridTemplateColumn UniqueName="chkScaledTemplateColumn" HeaderText="Is Available">
                           <ItemTemplate>
                               <asp:CheckBox runat="server" ID="chkAvail" OnCheckedChanged="chkAvail_OnCheckedChanged" Checked='<%#Eval("IsAvailable") %>' AutoPostBack="true"/>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                   </Columns>
               </telerik:GridTableView>
           </DetailTables>
           <Columns>
               <telerik:GridTemplateColumn UniqueName="ProductNameTemplateColumn" HeaderText="Product Name">
                           <ItemTemplate>
                               <asp:Label runat="server" ID="lblProductName" Text='<%#Eval("ProductName") %>'/>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
               <telerik:GridTemplateColumn UniqueName="txtCostTemplateColumn" HeaderText="Cost Price">
                   <ItemTemplate>
                       <asp:TextBox runat="server" ID="txtCost" Text='<%#ToCurrency(Eval("CostPrice")) %>'/>
                   </ItemTemplate>
               </telerik:GridTemplateColumn>
               <telerik:GridTemplateColumn UniqueName="txtMarkUpTemplateColumn" HeaderText="MarkUp">
                   <ItemTemplate>
                       <asp:TextBox runat="server" ID="txtMarkUp" Width="100px" OnTextChanged="txtTypeMarkUp_OnTextChanged" Text='<%#Eval("MarkUp") %>' AutoPostBack="true"/>
                   <asp:RegularExpressionValidator ID="regMarkUp" ControlToValidate="txtMarkUp"
                      ErrorMessage="Incorrect Percentage" runat="server" ValidationExpression='<%$ Resources:ValidationPatterns, Decimal %>'>[Invalid]</asp:RegularExpressionValidator>
                   </ItemTemplate>
               </telerik:GridTemplateColumn>
               <telerik:GridTemplateColumn UniqueName="txtFinalCostTemplateColumn" HeaderText="Final Cost" >
                   <ItemTemplate>
                       <asp:TextBox runat="server" ID="txtFinalCost" OnTextChanged="txtTypeFinalCost_OnTextChanged" Text='<%#ToCurrency(Eval("FinalPrice")) %>' AutoPostBack="true"/>
                    <asp:RegularExpressionValidator ID="regFinalCost" ControlToValidate="txtFinalCost"
                      ErrorMessage="Incorrect Final Price" runat="server" ValidationExpression='<%$ Resources:ValidationPatterns, Decimal %>'>[Invalid]</asp:RegularExpressionValidator>
                   </ItemTemplate>
               </telerik:GridTemplateColumn>
           </Columns>
       </MasterTableView>
   </telerik:RadGrid>
Iana Tsolova
Telerik team
 answered on 27 Sep 2010
8 answers
673 views
I have a radwindow which loads a user control containing a modal radtooltip. When the modaltooltip pops up it translates the overlay position and it's contents to the upper-left hand corner of the window. In other words, the tooltip overlay acts like the top left of the browser window is actually the top left of the radwindow.

I also noticed that on radwindows where there is a scrollbar that the loading indcator also seems to be the height of the window contents versus the height of the window. I might try putting the content into a scroll-able div versus the window scrollbar to see if it fixes it but wanted to ask what the problem may be...

Thanks!
Georgi Tunev
Telerik team
 answered on 27 Sep 2010
9 answers
790 views
I know that I must be missing something simple but I can't figure it out.  I have just changed all of my grids from the RadControls to the Prometheus controls.  In doing so (something I did or didn't do) broke.  When ever I try to use the CommandItemTemplate Update Button I get an error:

Only items with IsInEditMode set to true can be updated

Here is my commandItemTemplate:
<CommandItemTemplate> 
                        <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'> 
                            <img style="border:0px" alt="" src="~/Skins/DWDS/Grid/Update.gif" runat="server" /> Update Activity 
                        </asp:LinkButton> 

As far as I know it is the same as the Prometheus examples.  If I use the update button from the EditFormsSettings it works fine.

Here is the Grid:

<telerik:RadGrid ID="RadGrid1" Skin="DWDS" EnableEmbeddedSkins="false" ImagesPath="~/Skins/DWDS/Grid/" runat="server" Width="100%" PageSize="14"  
                AllowAutomaticDeletes="true" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
                AllowPaging="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" ShowStatusBar="true" AllowSorting="true" ShowFooter="true" AllowFilteringByColumn="true" > 
                <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
                <ExportSettings FileName="DeepWellData File Export" /> 
                <MasterTableView CommandItemDisplay="Top" CurrentResetPageIndexAction="SetPageIndexToFirst" ShowHeadersWhenNoRecords="true" DataKeyNames="Activity_ID" DataSourceID="SqlDataSource1" Width="100%" AutoGenerateColumns="false" EditMode="EditForms"> 
                    <CommandItemTemplate> 
                        <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'> 
                            <img style="border:0px" alt="" src="~/Skins/DWDS/Grid/Update.gif" runat="server" /> Update Activity 
                        </asp:LinkButton> 
                        &nbsp; 
                        <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'> 
                            <img style="border:0px" alt="" src="~/Skins/DWDS/Grid/Cancel.gif" runat="server" /> Cancel editing 
                        </asp:LinkButton> 
                        &nbsp; 
                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'> 
                            <img style="border:0px" alt="" src="~/Skins/DWDS/Grid/AddRecord.gif" runat="server" /> Add new Activity</asp:LinkButton> 
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'> 
                         <img style="border:0px" alt="" src="~/Skins/DWDS/Grid/Insert.gif" runat="server" /> Add this Activity</asp:LinkButton> 
                        &nbsp;&nbsp;&nbsp; 
                        <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"> 
                            <img style="border:0px" alt="" src="~/Skins/DWDS/Grid/Refresh.gif"  runat="server" /> Refresh Activity list 
                        </asp:LinkButton> 
                        &nbsp;&nbsp;&nbsp; 
                        <asp:Label ID="lblCategoryEdit" Visible="false" OnDataBinding="DisableCategoryEdit" runat="server"> 
                            <telerik:RadWindowManager ID="RadWindowManager2" runat="server" Height="500px" Width="480px" Modal="true"> 
                                <Windows> 
                                    <telerik:RadWindow OpenerElementID="aRegion" Width="480px" Height="450px" NavigateUrl="~/Projects/CaseFiles/AddRecord/Category.aspx" ID="RadWindow1" runat="server" /> 
                                </Windows> 
                            </telerik:RadWindowManager> 
                            <a id="aRegion" style="cursor: pointer;"> 
                                <img src="~/Skins/DWDS/Grid/Edit.gif" runat="server" border="0" alt="Edit Categories" />Add/Edit Categories</a> </asp:Label> 
                        <br /> 
                        &nbsp; 
                    </CommandItemTemplate> 
                    <Columns> 
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="~\Skins\DWDS\Grid\Edit.gif"  
                            UniqueName="EditColumn"> 
                            <HeaderStyle Width="25px" /> 
                            <ItemStyle HorizontalAlign="Center" Width="25px" /> 
                        </telerik:GridEditCommandColumn> 
                        <telerik:GridButtonColumn ConfirmText="Delete this activity?" ButtonType="ImageButton" ImageUrl="~\Skins\DWDS\Grid\Delete.gif" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"> 
                            <HeaderStyle Width="25px" /> 
                            <ItemStyle HorizontalAlign="Center" Width="25px" /> 
                        </telerik:GridButtonColumn> 
                        <telerik:GridBoundColumn DataField="Activity_ID" HeaderText="ID" ReadOnly="True" SortExpression="Name" UniqueName="Activity_ID" Visible="False" /> 
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Activity Name" ColumnEditorID="GridTextBoxColumnEditor1" SortExpression="Name" UniqueName="name" /> 
                        <telerik:GridBoundColumn DataField="PName" HeaderText="Partner" ReadOnly="True" Display="true" SortExpression="PName" UniqueName="PName" /> 
                        <telerik:GridBoundColumn DataField="Category_Name" HeaderText="Category" ReadOnly="True" Display="true" SortExpression="Category_Name" UniqueName="Category_Name" /> 
                        <telerik:GridDropDownColumn DataField="Partner_ID" ColumnEditorID="GridDropDownListColumnEditor1" DataSourceID="SqlDataSource2" HeaderText="Partner" ListTextField="Name" ListValueField="Partner_ID" 
                            UniqueName="pid" Display="false" /> 
                        <telerik:GridDropDownColumn DataField="Category_ID" ColumnEditorID="GridDropDownListColumnEditor2" DataSourceID="SqlDataSource3" HeaderText="Category" ListTextField="Name" ListValueField="Category_ID" 
                            UniqueName="cid" Display="false" /> 
                        <telerik:GridDropDownColumn DataField="Goal_Number" ColumnEditorID="GridDropDownListColumnEditor3" DataSourceID="SqlDataSource7" Visible="false" HeaderText="Goal #" ListTextField="Goal" 
                            ListValueField="Goal" UniqueName="Goal_number" /> 
                        <telerik:GridNumericColumn DataField="Completion_Hours" Visible="false" HeaderText="Completion Hours (in Minutes)" ColumnEditorID="GridNumericColumnEditor1" SortExpression="Completion_Hours" 
                            UniqueName="Completion_Hours" /> 
                        <telerik:GridTemplateColumn HeaderText="Details" AllowFiltering="false" DataField="Activity_ID" UniqueName="viewActivity"> 
                            <ItemTemplate> 
                                <div style="text-align: center"> 
                                    <asp:ImageButton ID="showItem" OnClick="showActivityDetails_Click" runat="server" ImageUrl="~/Images/Icons/magnifier.gif" CommandName="viewingActivity" CommandArgument='<%# Eval("Activity_ID") %>' /> 
                                </div> 
                            </ItemTemplate> 
                            <FooterTemplate> 
                                <div style="font-size: 11px; color: #5e7ca7; padding-top: 2px"> 
                                    Export to:<br /> 
                                    <asp:ImageButton ID="btnExcel" runat="server" ImageUrl="~/Images/Icons/excel.gif" AlternateText="Export to excel" OnClick="btnExcel_Click" />&nbsp;&nbsp; 
                                    <asp:ImageButton ID="btnWord" runat="server" ImageUrl="~/Images/Icons/word.gif" AlternateText="Export to word" OnClick="btnWord_Click" /> 
                                </div> 
                            </FooterTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridHTMLEditorColumn Visible="false" DataField="Notes" ColumnEditorID="GridHTMLEditorColumnEditor1" HeaderText="Notes" SortExpression="Notes" UniqueName="Notes" /> 
                        <telerik:GridBoundColumn Visible="false" DataField="Partner_ID" UniqueName="Partner_ID" ReadOnly="true" /> 
                        <telerik:GridBoundColumn DataField="PName" Visible="false" UniqueName="PName2" ReadOnly="true" /> 
                    </Columns> 
                    <EditFormSettings CaptionDataField="Name" CaptionFormatString="Edit properties of Activity: {0}" ColumnNumber="1"> 
                        <FormTableItemStyle Wrap="False" Width="400px"></FormTableItemStyle> 
                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                        <FormMainTableStyle GridLines="Horizontal" CellSpacing="10" CellPadding="10" BackColor="White" /> 
                        <FormTableStyle CellSpacing="10" CellPadding="10" CssClass="module" Height="150px" BackColor="White" /> 
                        <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                        <FormStyle Width="10%"></FormStyle> 
                        <EditColumn ButtonType="ImageButton" UpdateImageUrl="~\Skins\DWDS\Grid\Update.gif" EditImageUrl="~\Skins\DWDS\Grid\Edit.gif" InsertImageUrl="~\Skins\DWDS\Grid\Insert.gif" CancelImageUrl="~\Skins\DWDS\Grid\Cancel.gif" 
                            InsertText="Insert Activity" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> 
                        </EditColumn> 
                        <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> 
                    </EditFormSettings> 
                    <ExpandCollapseColumn Visible="False"> 
                        <HeaderStyle Width="19px" /> 
                    </ExpandCollapseColumn> 
                    <RowIndicatorColumn Visible="False"> 
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                </MasterTableView> 
            </telerik:RadGrid> 

Can someone point out what I am doing wrong?

Thanks
Iana Tsolova
Telerik team
 answered on 27 Sep 2010
3 answers
79 views
Hello everybody.
I am using Telerik in my production machine where it is installed. Now I want to know that can I execute my project designed by Telerik in another machine where visual studio is installed but Telerik is not installed? What is Telerik's portability?
Thank you.
Maria Ilieva
Telerik team
 answered on 27 Sep 2010
3 answers
184 views
I am using the declarative way ofdoing CRUD operation but I need to add a time stamp to a particular column as well.. Is there any east was to do this in the declarative framework??

Otherwise I guess I need to do everything programmatically and lose all the benefits of doing it declaratively.

Radoslav
Telerik team
 answered on 27 Sep 2010
9 answers
222 views
I've deployed the MOSS RadEditor to one of my Sharepoint sites. The editor works but all the changes I make to the toolsfile.xml do not show up.

The file I'm working on is this location on the server
C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.5.6.0__1f131a624888eeed\RadControls\Editor

the documentation says it should be in the ""~/RadControls/Editor" but I can't find this in my sharepoint structure anywhere

the changes I've made are simple, i removed a couple tools
    <tool name="ForeColor" />
    <tool name="BackColor" />
but they still show up. I've also tried to modify the font name list.

1) am i modifying the correct file?
2) if not, where is the toolsfile.xml exactly?

also, I have done an iisreset as well.
Thanks!
Rumen
Telerik team
 answered on 27 Sep 2010
1 answer
65 views
Hi,
In my asp.net page i have a radscheduler that i binds to a object list like this:
 RadSchedularCalendar.DataSource = woListFiltered;
 RadSchedularCalendar.DataBind();

then I need to add an another type of objects to the calendar, so I do it like this:
 foreach (CustomAppointment c in ourCATs)
            {
                //calculate the timespan
                TimeSpan dur=c.ToTime-c.FromTime;

                Appointment nCatApp=new Appointment();
                nCatApp.AllowDelete=true;
                nCatApp.AllowEdit=true;
                nCatApp.DataItem=c;
                nCatApp.Description=c.Comment;
                nCatApp.End=c.ToTime;
                nCatApp.Start=c.FromTime;
                nCatApp.Subject=c.TradesmanName+": "+c.TypeName;
                nCatApp.Visible=true;
                nCatApp.CssClass = "rsCategoryRed";
                
                RadSchedularCalendar.InsertAppointment(nCatApp);
            }

the problem is that, when editing / deleteing appointments bounded to the radscheduler (RadSchedularCalendar.DataSource = woListFiltered;), the AppointmentUpdate and AppointmentDelete is triggered as normal, but when editing / deleting appointments added by the foreach loop those event won't trigger.

An another problem that I have is that I need to open the default advanced edit form or a advanced edit form defined in an themplate when double clicking on an appointment added with the DataSource method, and run some code behind when the user double clicks on an appointment added with the foreach method.

Any help is highly appriciated :)
Peter
Telerik team
 answered on 27 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?