Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
292 views

I am using  a RadGrid in my project and i want to take rowindex in OnCommand (JavaScript) Function . Is it possible or how can i do it ??


<
telerik:RadGrid ID="RadGrid1" runat="server" Width="96%" GridLines="None" Skin="Vista"

 

 

AutoGenerateColumns="False" AllowFilteringByColumn="True" PageSize="13"

 

 

ShowStatusBar="True" OnUpdateCommand="RadGrid1_UpdateCommand"

 

OnInsertCommand="RadGrid1_InsertCommand"

 

 

OnDeleteCommand="RadGrid1_DeleteCommand"

 

OnNeedDataSource="RadGrid1_NeedDataSource"

 

OnItemDataBound="RadGrid1_ItemDataBound"

 

ShowFooter="True"">

 

<MasterTableView DataKeyNames="MuhFisDetayId" AllowMultiColumnSorting="True" Width="100%"

 

 

CommandItemDisplay="Top" EditMode="InPlace" InsertItemDisplay="Top">

 

<Columns>

 

 

<telerik:GridDropDownColumn DataField="HesapId" DataSourceID="LLBLGenProDataSource3"  

 

 

HeaderText="HesapKodu" ListTextField="HesapKodu" ListValueField="HesapId" UniqueName="HesapId">

 

 

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

 

</telerik:GridDropDownColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Alacak" UniqueName="TemplateColumnAlacak"  EditFormColumnIndex="2">

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

<%# Eval("Alacak")%>

 

 

 

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

 

 

<telerik:RadNumericTextBox runat="server" ID="tbAlacak" Width="40px" DbValue='<%# Bind("Alacak") %>' DataType="Decimal">

 

 

 

 

 

 

</telerik:RadNumericTextBox>

 

 

 

 

 

 

</EditItemTemplate>

 

 

 

 

 

 

<FooterTemplate>

 

<asp:Label runat="server" ID="lblAlacakToplam" Text="" Font-Bold="true" Font-Names="Verdana" ForeColor="#000000"></asp:Label 

 

</FooterTemplate>

 

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn"

 

 

 

CancelText="Cancel" EditText="Update">

 

 

 

 

<HeaderStyle Width="85px"></HeaderStyle>

 

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" />

 

 

</Columns>

 

 

 

<EditFormSettings CaptionFormatString="{0} Update" CaptionDataField="MuhFisDetayId">

 

 

 

 

<EditColumn ButtonType="ImageButton" />

 

 

 

 

<FormStyle BackColor="#eef2ea" Width="100%" />

 

 

<FormTableStyle CellPadding="2" CellSpacing="0" GridLines="None" />

 

 

<FormTableItemStyle Height="29px" Width="100%" />

 

 

 

</EditFormSettings>

 

 

 

 

</MasterTableView>

 

 

 

 

<ClientSettings>

 

 

<ClientEvents OnCommand="onCommand" />

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

 

</ClientSettings>
</telerik:RadGrid>

 

 

 

 

Nils C.
Top achievements
Rank 1
 answered on 09 Aug 2012
4 answers
206 views
I have something similar to the demo; however my code uses a Form Template to define the "editing" form fields...the demo doesn't.

How can i leverage the demo code but reference a FormTemplate for RadUploading to a database?

My code has this...
<Columns> 
                <telerik:GridBoundColumn DataField="ArticleID" DataType="System.Guid" HeaderText="ArticleID" 
                    ReadOnly="True" SortExpression="ArticleID" UniqueName="ArticleID" Visible="False" 
                    HeaderStyle-Wrap="False"
                    <HeaderStyle Wrap="False"></HeaderStyle> 
                </telerik:GridBoundColumn> 
                <telerik:GridTemplateColumn DataField="ArticleTitle" HeaderText="Article Title" UniqueName="ArticleTitle"
                    <ItemTemplate> 
                        <asp:HyperLink ID="hypArtID" Text='<%# Bind("ArticleTitle") %>' NavigateUrl='<%#"~/articles/article_view.aspx?ArticleID=" + DataBinder.Eval (Container.DataItem, "ArticleID") %>' 
                            runat="server"></asp:HyperLink> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="ArticleSubject" HeaderText="Article Subject" 
                    SortExpression="ArticleSubject" UniqueName="ArticleSubject" HeaderStyle-Wrap="False" 
                    ItemStyle-VerticalAlign="Top" Visible="false"
                    <HeaderStyle Wrap="False"></HeaderStyle> 
                    <ItemStyle VerticalAlign="Top"></ItemStyle> 
                </telerik:GridBoundColumn> 
                <telerik:GridTemplateColumn DataField="ArticleContent" HeaderText="Article Content" 
                    SortExpression="ArticleContent" UniqueName="ArticleContent" ItemStyle-VerticalAlign="Top"
                    <ItemTemplate> 
                        <asp:Label ID="ArticleContentLabel" runat="server" Width="300px" Text='<%# Truncate(DataBinder.Eval (Container.DataItem, "ArticleContent")) %>'></asp:Label> 
                    </ItemTemplate> 
                    <ItemStyle VerticalAlign="Top"></ItemStyle> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="ArticleDateTime" DataType="System.DateTime" 
                    HeaderText="Article Date" SortedBackColor="LightGray" SortExpression="ArticleDateTime" 
                    UniqueName="ArticleDateTime" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top"
                    <ItemTemplate> 
                        <asp:Label ID="ArticleDateTimeLabel" runat="server" Text='<%# Eval("ArticleDateTime","{0:d}") %>'></asp:Label> 
                    </ItemTemplate> 
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Top"></ItemStyle> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="ArticleExp" DataType="System.DateTime" HeaderText="ArticleExp" 
                    SortExpression="ArticleExp" UniqueName="ArticleExp" Visible="False" HeaderStyle-Wrap="False" 
                    ItemStyle-VerticalAlign="Top"
                    <HeaderStyle Wrap="False"></HeaderStyle> 
                    <ItemStyle VerticalAlign="Top"></ItemStyle> 
                </telerik:GridBoundColumn> 
                <telerik:GridCheckBoxColumn DataField="ArticleExpChkBox" DataType="System.Boolean" 
                    HeaderText="ArticleExpChkBox" SortExpression="ArticleExpChkBox" UniqueName="ArticleExpChkBox" 
                    Visible="False" HeaderStyle-Wrap="False" ItemStyle-VerticalAlign="Top"
                    <HeaderStyle Wrap="False"></HeaderStyle> 
                    <ItemStyle VerticalAlign="Top"></ItemStyle> 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridTemplateColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName" 
                    UniqueName="UserName" Visible="False"
                </telerik:GridTemplateColumn> 
                <telerik:GridBinaryImageColumn DataField="ArticleBillboardImage" HeaderText="Article Image" 
                    ImageAlign="NotSet" ResizeMode="Fit" ImageHeight="199px" ImageWidth="135px" DataAlternateTextFormatString="Image of {0}" 
                    DataAlternateTextField="ArticleBillboardImageDesc" UniqueName="ArticleBillboardImage" 
                    Visible="False"
                </telerik:GridBinaryImageColumn> 
                <telerik:GridTemplateColumn DataField="ArticleBillboardImageName" HeaderText="Article Image Name" 
                    UniqueName="ArticleBillboardImageName" Visible="False"
                    <ItemTemplate> 
                        <asp:Label runat="server" ID="lblArticleBillboardImageName" Text='<%# Eval("ArticleBillboardImageName") %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="ArticleBillboardImageDesc" HeaderText="Article Image Description" 
                    UniqueName="ArticleBillboardImageDesc" Visible="False"
                    <ItemTemplate> 
                        <asp:Label runat="server" ID="lblArticleBillboardImageDesc" Text='<%# Truncate(DataBinder.Eval (Container.DataItem, "ArticleBillboardImageDesc")) %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <EditFormSettings EditFormType="Template"
                <FormTemplate> 
                    <table id="ArticleEditForm" width="100%"
                        <tr> 
                            <td style="padding-left: 5px"
                                Article Title 
                            </td> 
                            <td align="left"
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ArticleTitle", "{0}") %>' 
                                    Width="200px"></asp:TextBox> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                Article Subject 
                            </td> 
                            <td align="left"
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ArticleSubject", "{0}") %>' 
                                    Width="200px"></asp:TextBox> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                Article Posted 
                            </td> 
                            <td align="left"
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ArticleDateTime") %>' ReadOnly="True"></asp:TextBox> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                Article Expiration 
                            </td> 
                            <td align="left"
                                <telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server" Culture="English (United States)" 
                                    Skin="Default" DbSelectedDate='<%# Bind("ArticleExp", "{0:g}") %>'
                                    <TimePopupButton HoverImageUrl="" ImageUrl="" /> 
                                    <TimeView ID="TimeView2" runat="server" CellSpacing="-1"
                                    </TimeView> 
                                    <Calendar ID="Calendar2" runat="server" Skin="Hay" UseColumnHeadersAsSelectors="False" 
                                        UseRowHeadersAsSelectors="False" ViewSelectorText="x"
                                    </Calendar> 
                                    <DatePopupButton HoverImageUrl="" ImageUrl="" /> 
                                </telerik:RadDateTimePicker> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                User Name 
                            </td> 
                            <td align="left"
                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("UserName") %>'></asp:Label> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                Article UserID 
                            </td> 
                            <td align="left"
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("UserID", "{0}") %>'></asp:Label> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                Article Content 
                            </td> 
                            <td align="left"
                                <telerik:RadEditor Width="99%" ID="RadEditor1" runat="server" Content='<%# Bind("ArticleContent") %>' 
                                    ToolbarMode="ShowOnFocus" EnableTheming="True" EnableResize="False" ToolsFile="~/admin/Tools/ToolsFile.xml"
                                    <Languages> 
                                        <telerik:SpellCheckerLanguage Code="en-US" Title="English" /> 
                                    </Languages> 
                                    <CssFiles> 
                                        <telerik:EditorCssFile Value="~/admin/Tools/CSS/EditorContentArea.css" /> 
                                    </CssFiles> 
                                    <Modules> 
                                        <telerik:EditorModule Name="RadEditorStatistics" Enabled="true" /> 
                                    </Modules> 
                                </telerik:RadEditor> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="padding-left: 5px"
                                Article Image 
                            </td> 
                            <td align="left"
                                <telerik:RadBinaryImage ID="RadBinaryImage1" DataValue='<%#Eval("ArticleBillboardImage") is DBNull ? null : Eval("ArticleBillboardImage")%>' Height="199px"  Width="135px" ToolTip='<%#Eval("ArticleBillboardImageDesc", "Photo of {0}") %>' 
                                AlternateText='<%#Eval("ArticleBillboardImageDesc", "Photo of {0}") %>' runat="server" ResizeMode="Crop" /> 
                                 
                            </td> 
                            <td> 
                                <telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> 
                             
                            </td> 
                        </tr> 
                        <tr> 
                        <td style="padding-left: 5px">Upload Image:</td> 
                        <td> 
                            <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" AllowedFileExtensions=".png, .jpg, .gif" MaxFileInputsCount="1" OverwriteExistingFiles="True"
                            </telerik:RadUpload><br /> 
                            <telerik:RadAsyncUpload ID="RadAsyncUpload1" ControlObjectsVisibility="None" AllowedFileExtensions=".png, .jpg, .gif" runat="server" MaxFileInputsCount="1" OverwriteExistingFiles="True"
                            </telerik:RadAsyncUpload> 
                            </td> 
 
                        </tr> 
                                                <tr> 
                            <td style="padding-left: 5px"
                                Article Image Name 
                            </td> 
                            <td align="left"
                                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("ArticleBillboardImageName") %>'></asp:TextBox> 
                            </td> 
                        </tr> 
                                                <tr> 
                            <td style="padding-left: 5px"
                                Article Image Description 
                            </td> 
                            <td align="left"
                                <asp:TextBox Rows="5"  MaxLength="500" ID="TextBox4"  
                                    Text='<%# Bind("ArticleBillboardImageDesc") %>' runat="server"  
                                    TextMode="MultiLine" Width="300px"></asp:TextBox> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class=""
                                &nbsp; 
                            </td> 
                            <td align="right"
                                &nbsp; 
                            </td> 
                        </tr> 
                        <tr> 
                            <td> 
                                &nbsp; 
                            </td> 
                            <td align="right"
                                <asp:Button ID="btnUpdate" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' /> 
                                &nbsp; 
                                <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" 
                                    Text="Cancel" /> 
                            </td> 
                        </tr> 
                    </table> 
                </FormTemplate> 
In the code i have listed...i was testing with both the RadUpload and the AsyncRadUpload...not sure would be a better fit.

Also, i'm not sure if i need to include the logic from the demo for the postback issues?

Thanks,
Greg



Helen
Telerik team
 answered on 09 Aug 2012
7 answers
289 views
I'm using a file manager control with AsyncUpload enabled:

<telerik:RadFileExplorer ID="expTCDrive" runat="server" EnableCopy="true" OnClientFileOpen="OnClientFileOpen"
                EnableFilterTextBox="true" EnableFilteringOnEnterPressed="false" Width="750px"
                OnClientFolderChange="OnClientFolderChange" Height="500px" EnableAsyncUpload="true">
                <Configuration MaxUploadFileSize="52428800" />
            </telerik:RadFileExplorer>

From time to type, we are receiving the following exception

Error in: https://oursite/ourfolder/Telerik.Web.UI.WebResource.axd?type=rau

Error message: Object reference not set to an instance of an object.

Stack trace:    at Telerik.Web.UI.AsyncUploadHandler.ProcessRequest(HttpContext context)

   at Telerik.Web.UI.HandlerRouter.ProcessHandler(String handlerKey, HttpContext context)

   at Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context)

   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Any ideas why this would be happening? I've tried several different things and was hoping that I could recreate it, but I can't. I was thinking that perhaps it was being caused by the Upload button being enabled while it was still uploading in the previous version, but with the latest release, that issue has been fixed and the error still occurs. If it helps, I can package up the entire project and send it as a support ticket.

Thanks,
Adam
Rohan
Top achievements
Rank 1
 answered on 09 Aug 2012
1 answer
200 views
I Have a RadSlider with that code
<telerik:RadSlider ID="RadSliderResBedrooms" runat="server" ItemType="item" Width="350px"
                                Height="70px" AnimationDuration="400" ThumbsInteractionMode="Free"
                                EnableDragRange="true" IsSelectionRangeEnabled="true" SelectionEnd="12" SelectionStart="0" >
                                <Items>
                                    <telerik:RadSliderItem Text="1" Value="1" Width="100px" />
                                    <telerik:RadSliderItem Text="2" Value="2" />
                                    <telerik:RadSliderItem Text="3" Value="3" />
                                    <telerik:RadSliderItem Text="4" Value="4" />
                                    <telerik:RadSliderItem Text="5" Value="5" />
                                    <telerik:RadSliderItem Text="6" Value="6" />
                                    <telerik:RadSliderItem Text="7" Value="7" />
                                    <telerik:RadSliderItem Text="8" Value="8" />
                                    <telerik:RadSliderItem Text="9" Value="9" />
                                    <telerik:RadSliderItem Text="10" Value="10" />
                                    <telerik:RadSliderItem Text="11" Value="11" />
                                    <telerik:RadSliderItem Text="12" Value="12" />
                                </Items>
                            </telerik:RadSlider>

The problem that its width when the page first loads is very small and looked crashed but after reloading pages it goes 
that's the crashed slider image:
http://i.imgur.com/wWGm0.png
Slav
Telerik team
 answered on 09 Aug 2012
1 answer
754 views
Hi All,

I am facing a situation where I need a grid where there are multiple rows. Now, inside each row there can be multiple child rows and each child row should be editable.

Eg.

Col1         Col2        Col3    Col4   (Row1)
                Col2        Col3    Col4
                Col2        Col3    Col4


Above is only 1 row. So, in that Col1 is repeating only once, but other columns are repeating mulitple times, as well as they are editable (but Col1 is not editable). So, now on saving all the data from Row1 should go to database.

The good thing is that only one row is editable at a time. I want the look and feel exactly like this....Actually grouping does not give a look and feel like this and I don't know whether it is editable or not....

If anyone can put a light into this then it will be of good help....Thanks in advance.

Dhaval Tamhane
Radoslav
Telerik team
 answered on 09 Aug 2012
1 answer
244 views
I have a user control that is displayed via the content template of RadWindow .

The user control has a textbox with a requiredFieldValidator that doesnt get fired on client side when a button is clicked in the same user control.

Sample code: 

<telerik:RadWindow ID="sample" runat="server"
        Title="My Sample" Modal="true" Width="800px" Height ="720px"  >
        <ContentTemplate>
            <UC1:Sample runat="server" ID="sampleControl" />
        </ContentTemplate>
    </telerik:RadWindow>
 
-- User control contents --
<div>
 <telerik:RadTextBox ID="txtTest" runat="server" CausesValidation="true" />
                        <asp:RequiredFieldValidator ID="rfv" ControlToValidate="txtTest" runat="server" Display="Dynamic"
                        ErrorMessage="*" Text="*" />
</div>
<telerik:RadButton ID="radButton" runat="server" Text="Click me" CausesValidation="true" />

This happens when i make the an partial postback using ajax rather than a complete postback.
Marin Bratanov
Telerik team
 answered on 09 Aug 2012
2 answers
728 views
My users want the ability to receive a warning if they leave a page without hitting the save button.  I found some great code at 4GuysFromRolla, and have been able to make a necessary adjustment  to get it working with the RadComboBox.  I am struggling on finding the right change for the RadEditor.  What is the correct html element id to put in the following code?

'Dont forget to register controls on the Page_load even.
'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'    'Monitor the changes for the Web controls whose values you want to watch
'    MonitorChanges(InputControlname)
'    'For those controls (like "Save" buttons) that cause a postback that should NOT prompt the
'    'user, call BypassModifiedMethod
'    BypassModifiedMethod(btnSave)
'End Sub
Public Sub MonitorChanges(ByVal wc As WebControl)
    If wc Is Nothing Then Exit Sub
    If TypeOf wc Is CheckBoxList OrElse TypeOf wc Is RadioButtonList Then
        'Add an array element for each item in the checkbox/radiobutton list
        For i As Integer = 0 To CType(wc, ListControl).Items.Count - 1
            ClientScript.RegisterArrayDeclaration("monitorChangesIDs", """" & String.Concat(wc.ClientID, "_", i) & """")
            ClientScript.RegisterArrayDeclaration("monitorChangesValues", "null")
        Next
    ElseIf TypeOf wc Is Telerik.Web.UI.RadComboBox Then
        ClientScript.RegisterArrayDeclaration("monitorChangesIDs", """" & wc.ClientID & "_Input" & """")
        ClientScript.RegisterArrayDeclaration("monitorChangesValues", "null")
    ElseIf TypeOf wc Is Telerik.Web.UI.RadEditor Then
        'Not working.  Still need to find the correct ID Value.
        ClientScript.RegisterArrayDeclaration("monitorChangesIDs", """" & wc.ClientID & "ContentHiddenTextarea" & """")
        ClientScript.RegisterArrayDeclaration("monitorChangesValues", "null")
    Else
        ClientScript.RegisterArrayDeclaration("monitorChangesIDs", """" & wc.ClientID & """")
        ClientScript.RegisterArrayDeclaration("monitorChangesValues", "null")
    End If
    AssignMonitorChangeValuesOnPageLoad()
End Sub
Private Sub AssignMonitorChangeValuesOnPageLoad()
    If Not ClientScript.IsStartupScriptRegistered("monitorChangesAssignment") Then
        ClientScript.RegisterStartupScript(Me.GetType(), "monitorChangesAssignment", _
           "<script language=""JavaScript"">" & vbCrLf & _
           "  assignInitialValuesForMonitorChanges();" & vbCrLf & _
           "</script>")
        ClientScript.RegisterClientScriptBlock(Me.GetType(), "monitorChangesAssignmentFunction", _
           "<script language=""JavaScript"">" & vbCrLf & _
           "  function assignInitialValuesForMonitorChanges() {" & vbCrLf & _
           "    for (var i = 0; i < monitorChangesIDs.length; i++) {" & vbCrLf & _
           "      var elem = document.getElementById(monitorChangesIDs[i]);" & vbCrLf & _
           "      if (elem) if (elem.type == 'checkbox' || elem.type == 'radio') monitorChangesValues[i] = elem.checked; else monitorChangesValues[i] = elem.value;" & vbCrLf & _
           "    }" & vbCrLf & _
           "  }" & vbCrLf & vbCrLf & vbCrLf & _
           "  var needToConfirm = true;" & vbCrLf & _
           "  window.onbeforeunload = confirmClose;" & vbCrLf & vbCrLf & _
           "  function confirmClose() {" & vbCrLf & _
           "    if (!needToConfirm) return;" & vbCrLf & _
           "    for (var i = 0; i < monitorChangesValues.length; i++) {" & vbCrLf & _
           "      var elem = document.getElementById(monitorChangesIDs[i]);" & vbCrLf & _
           "      if (elem) if (((elem.type == 'checkbox' || elem.type == 'radio') && elem.checked != monitorChangesValues[i]) || (elem.type != 'checkbox' && elem.type != 'radio' && elem.value != monitorChangesValues[i])) { needToConfirm = false; setTimeout('resetFlag()', 750); return ""You have modified the data entry fields since last savings.  If you leave this page, any changes will be lost.  To save these changes, click Cancel to return to the page, and then Save the data.""; }" & vbCrLf & _
           "    }" & vbCrLf & _
           "  }" & vbCrLf & vbCrLf & _
           "  function resetFlag() { needToConfirm = true; } " & vbCrLf & _
           "</script>")
    End If
End Sub
Public Sub BypassModifiedMethod(ByVal wc As WebControl)
    wc.Attributes("onclick") = "javascript:" & GetBypassModifiedMethodScript()
End Sub
Public Function GetBypassModifiedMethodScript() As String
    Return "needToConfirm = false;"
End Function

Thanks for your help,
Dan Neuman
Dan
Top achievements
Rank 1
 answered on 09 Aug 2012
2 answers
168 views
I have a Radgrid already defined in the aspx file

<telerik:RadGrid ID="rgTest" runat="server" >
    <MasterTableView AllowPaging="False" CommandItemDisplay="Top">
        <Columns>
            <telerik:GridBoundColumn DataField="test" FilterControlAltText="Filter by test"
                HeaderText="Text" UniqueName="test" SortExpression="test">
        </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="test1" FilterControlAltText="Filter by test1"
                HeaderText="Test1" UniqueName="test1" >
        </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

I created 2 columns, "test" and "test1", and the datasource of the grid is defined as above:

Protected Sub rgTest_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rgTEst.NeedDataSource
    LoadPreview()
End Sub
 
Private Sub LoadPreview()
    Dim obj As New TestDataAccess
    Dim ds As DataSet = obj.PreviewGet() 'Return a dataset from the database
    rgTest.DataSource = ds
End Sub

but that datasource returns a lot of columns based on an sproc that create columns dynamically and I don't know how many columns will created, not even the columns names, but for sure brings these 2 ("test", "test1").
The problem is that i am getting these 2 columns repeated, and i just want to show them once, How can I do this?

PD: I note when the grid is creating the columns, the ones that I don't want to repeat, come with a 1 attached to the name, test1, test11
reguapo
Top achievements
Rank 1
 answered on 09 Aug 2012
0 answers
140 views
hi im using rad calendar(i think 2005 onwards i bought this control) on my page. every thing is aligned well  in chrome, except this rad calendar issue.
here is my sample code
<div id="divSearch">
                <!-- PAGE SPECIFIC CONTENT -->
                <table id="tabsearchcriteria" width="100%">
                <!--Search Section-->
                    <tr>
                        <td class="searchlabel" >
                           <asp:Label ID="lbl1" runat="server"></asp:Label>
                        </td>
                        <td class="searchtext" >                          
                           <asp:TextBox runat="server" ID="txt1" CssClass="searchtext" MaxLength="8" onkeypress="uppercase();"/>
                        </td>
                        <td class="searchlabel" >
                            <asp:Label ID="lbl2" runat="server"></asp:Label>
                        </td>
                        <td class="searchtext">
                            <asp:TextBox ID="txt2" runat="server" CssClass="searchtext" MaxLength="8"></asp:TextBox>
                        </td>                   
                    </tr>
                    <tr>
                        <td class="searchlabel" >
                            <asp:Label ID="lblFmDt" runat="server"></asp:Label>
                        </td>
                        <td class="searchtext">                                       

                            <radCln:RadCalendar ID="SharedCalendar" runat="server" EnableMultiSelect="false"
                                RangeMinDate="2006/01/01" Skin="WebBlue">
                            </radCln:RadCalendar>
                            <radCln:RadDatePicker ID="txtRetDtFm" runat="server" MinDate="1980-01-01" SharedCalendarID="SharedCalendar"
                                Width="90px">
                                <DatePopupButton HoverImageUrl="~/RadControls/Calendar/Skins/WebBlue/Img/datePickerPopupHover.gif"
                                    ImageUrl="~/RadControls/Calendar/Skins/WebBlue/Img/datePickerPopup.gif"></DatePopupButton>
                                <DateInput ReadOnly="true" BorderColor="#6D91BF">
                                </DateInput>
                            </radCln:RadDatePicker>
                        </td>
                        .....................

the UI looks, that calendar is aligned bit left compared with other controls, this problem is in chrome and mozila only. may i know how to fix this issue?
jeyaseelan
Top achievements
Rank 1
 asked on 09 Aug 2012
1 answer
69 views
Hi,

          I have used EditFormSettings in my RadGrid. I am also having two buttons one is New and Edit too. I have checkbox and a column (Image Name) in grid. So when click new button, it is creating a row for insertion. At the same time, without entering any information in edit mode, I am clicking the check box, at this time I wanted to remove the created row (which is in insert mode). How to do this? Is it possible to do?

The following statement is not working..

MyRadGrid.MasterTableView.ClearEditItems();


Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 09 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?