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

Edit: Looks like I posted this in wrong place. Now posted in feedback and bugs.

 

When assigning multiple resources and percentages, the first item in list always goes back to 100%.

It saves back to UI correctly but as soon as you leave or refresh page it goes back to 100% on first item and that's what's saved in database.

The online demo has the same code but demo doesn't save at all.

See attached screen shots.

Attila Antal
Telerik team
 updated answer on 02 Jan 2024
0 answers
99 views

I have a bound grid that contains an image.  Since the image is about the size of a thumbnail...I want to give the user the ability to click the image and have it displayed in full.  I figured a good way to do this would be to use a RadLightBox.  Am I barking down the right path?  Is there a better way?  


                        <telerik:RadGrid ID="rgMain" runat="server" Width="100%" AutoGenerateColumns="False">
                            <MasterTableView EditMode="PopUp" ShowHeadersWhenNoRecords="True" EnableNoRecordsTemplate="True" DataKeyNames="RaceID" CommandItemDisplay="Top">
                                <CommandItemSettings ShowRefreshButton="False" ShowAddNewRecordButton="False" />
                                <Columns>
                                    <telerik:GridBoundColumn UniqueName="RaceName" DataField="RaceName" HeaderText="Race Name"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="SeriesName" DataField="SeriesName" HeaderText="Series"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="RaceDesc" DataField="RaceDesc" HeaderText="Description"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="RaceDate" DataField="RaceDate" HeaderText="Date" DataFormatString="{0:MM/dd/yyyy}"></telerik:GridBoundColumn>
                                    <telerik:GridHyperLinkColumn DataNavigateUrlFields="RaceRegLink" HeaderText="Registration Link" DataTextField="RaceRegLink" Target="_blank"></telerik:GridHyperLinkColumn>
                                </Columns>
                                <DetailTables>
                                    <telerik:GridTableView Name="Members" DataKeyNames="MemberID,RaceID" ClientDataKeyNames="MemberID,RaceID" Width="100%" ShowFooter="True">
                                        <ParentTableRelation>
                                            <telerik:GridRelationFields MasterKeyField="RaceID" DetailKeyField="RaceID" />
                                        </ParentTableRelation>
                                        <NoRecordsTemplate>No records to display.</NoRecordsTemplate>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="Member" UniqueName="Member">
                                                <ItemTemplate>
                                                    <telerik:RadBinaryImage ID="imgProfPic" runat="server" ImageUrl="~/images/ProfilePicBlank.jpg" Height="50px" Width="50px"
                                                        ResizeMode="Fit" DataValue='<%# IIf(Eval("ProfPic") IsNot DBNull.Value, Eval("ProfPic"), New System.Byte(-1) {})%>'
                                                        AlternateText='<%# Eval("MemberID") %>' />
                                                    <asp:Label runat="server" Text='<%# Eval("FullName") %>'></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn UniqueName="Division" DataField="Division" HeaderText="Division"></telerik:GridBoundColumn>
                                        </Columns>                                        
                                        <HeaderStyle Font-Bold="True" BackColor="Silver" />
                                    </telerik:GridTableView>
                                </DetailTables>                                
                                <NoRecordsTemplate>
                                    No records to display.
                                </NoRecordsTemplate>
                                <HeaderStyle Font-Bold="True" BackColor="#CCCCCC" />
                            </MasterTableView>
                        </telerik:RadGrid>

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 asked on 28 Dec 2023
1 answer
176 views

I followed the documentation example for using a check box column(see link below).  The issue I'm having is when the BatchEditCommand event fires after the clicking the "Save Changes" item command button, the BatchEditCommand object is always empty so I cannot get the Hash table values to update the record without without using the Open-Edit click event.  

Also, can someone provide a sample of using this method with a RadSwitch instead of a checkbox? 

Thanks in advance for any help.

Editing Check Boxes Directly in Batch Mode

 Markup

<telerik:RadGrid ID="grdCategory" runat="server" AutoGenerateColumns="false" CssClass="Gridheight4" Width="100%" AllowPaging="true" PageSize="7">
      <ClientSettings> 
         <Scrolling AllowScroll="true" UseStaticHeaders="true" />
         <KeyboardNavigationSettings AllowSubmitOnEnter="true" />  
      </ClientSettings>
   <MasterTableView DataKeyNames="Category" EditMode="Batch" HeaderStyle-Font-Size="8pt" HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="8pt"  PagerStyle-AlwaysVisible="true" CommandItemDisplay="Top" InsertItemDisplay="Top"
     AllowAutomaticUpdates="true" AllowAutomaticInserts="true" BatchEditingSettings-EditType="Row" BatchEditingSettings-OpenEditingEvent="Click">
    <CommandItemSettings ShowSaveChangesButton="true" ShowCancelChangesButton="true" ShowRefreshButton="true"/>                                
    <Columns>                                                
      <telerik:GridBoundColumn DataField="Category" UniqueName="Category" HeaderText="Category" DataType="System.String" ForceExtractValue="Always" ItemStyle-CssClass="maximize"></telerik:GridBoundColumn>
      <telerik:GridTemplateColumn DataField="Is_Active" UniqueName="Is_Active" HeaderText="Active" HeaderStyle-Width="80px">
     <ItemTemplate>
        <asp:CheckBox runat="server" ID="CheckBox1" Enabled="true" Checked='<%# Eval("Is_Active") %>' onclick="checkbox1Click(this, event);" />
     </ItemTemplate>
     <EditItemTemplate>
         <asp:CheckBox runat="server" ID="CheckBox2" />
            </EditItemTemplate>
     </telerik:GridTemplateColumn>
     <telerik:GridCheckBoxColumn DataField="CCD_Only" UniqueName="CCD_Only" HeaderText="CCD Only" HeaderTooltip="Show for CCD UMs Only.." DataType="System.Boolean"></telerik:GridCheckBoxColumn>
     <telerik:GridCheckBoxColumn DataField="MMS_Only" UniqueName="MMS_Only" HeaderText="MMS Only" HeaderTooltip="Medication Management Only.."  DataType="System.Boolean"></telerik:GridCheckBoxColumn>
     <telerik:GridBoundColumn DataField="Comments" UniqueName="Comments" HeaderText="Comments" DataType="System.String"></telerik:GridBoundColumn>
     </Columns>
  </MasterTableView>
</telerik:RadGrid>

Client Script

 function checkbox1Click(sender, args) {
      var grid = $find("<%= grdCategory.ClientID %>");
      var batchEditingManager = grid.get_batchEditingManager();
      var parentCell = $telerik.$(sender).closest("td")[0];
      var initialValue = sender.checked;
      batchEditingManager.changeCellValue(parentCell, initialValue);
    }

VB Code Behind

Private Function CategoryData(Optional ByVal Command As String = "", Optional ByVal Category As String = "", Optional ByVal Is_Active As Boolean = True, Optional ByVal CCD_Only As Boolean = False, Optional ByVal MMS_Only As Boolean = False, Optional ByVal Comments As String = "") As DataTable
        Dim strConn As String = ConfigurationManager.ConnectionStrings("UMDB").ToString
        Dim strSQL As String = ""
        Dim dt As DataTable = Nothing

        Select Case Command
            Case PerformInsertCommandName
                strSQL = "EXEC dbo.usp_ins_Lookup_UM_Category "
                strSQL &= "@Category = " & SQL_Prepare_String(Category)
                strSQL &= ", @Is_Active = " & SQL_Prepare_Boolean(Is_Active)
                strSQL &= ", @CCD_Only = " & SQL_Prepare_Boolean(CCD_Only)
                strSQL &= ", @MMS_Only = " & SQL_Prepare_Boolean(MMS_Only)
                strSQL &= ", @Comments = " & SQL_Prepare_String(Comments)
                ExecuteSQL(strSQL, strConn)
                Return dt
            Case UpdateCommandName
                strSQL = "EXEC dbo.usp_upd_Lookup_UM_Category "
                strSQL &= "@Category = " & SQL_Prepare_String(Category)
                strSQL &= ", @Is_Active = " & SQL_Prepare_Boolean(Is_Active)
                strSQL &= ", @CCD_Only = " & SQL_Prepare_Boolean(CCD_Only)
                strSQL &= ", @MMS_Only = " & SQL_Prepare_Boolean(MMS_Only)
                strSQL &= ", @Comments = " & SQL_Prepare_String(Comments)
                ExecuteSQL(strSQL, strConn)
                Return dt
            Case Else
                strSQL = "EXEC dbo.usp_get_Lookup_UM_Category"
                Dim ds As DataSet = GetDataSet(strSQL, 30, strConn)
                dt = ds.Tables(0)
                Return dt
        End Select

    End Function
 '================
 Private Sub grdCategory_PreRender(sender As Object, e As EventArgs) Handles grdCategory.PreRender
        For Each column As GridColumn In grdCategory.Columns
            If column.UniqueName = "Category" Then
                If column.Owner.IsItemInserted Then
                    CType(column, GridEditableColumn).ReadOnly = False
                Else
                    CType(column, GridEditableColumn).ReadOnly = True
                End If
            End If
        Next
        grdCategory.Rebind()

    End Sub
'================
Private Sub grdCategory_BatchEditCommand(sender As Object, e As GridBatchEditingEventArgs) Handles grdCategory.BatchEditCommand
        For Each command As GridBatchEditingCommand In e.Commands
            Dim newValues As Hashtable = command.NewValues
            Dim oldValues As Hashtable = command.OldValues
            Dim strCategory As String = newValues("Category")
            Dim blnActive As Boolean = newValues("Is_Active")
            Dim blnCCDOnly As Boolean = newValues("CCD_Only")
            Dim blnMMSOnly As Boolean = newValues("MMS_Only")
            Dim strComments As String = newValues("Comments")
            If command.Type = GridBatchEditingCommandType.Update Then
                CategoryData("Update", strCategory, blnActive, blnCCDOnly, blnMMSOnly, strComments)
            ElseIf command.Type = GridBatchEditingCommandType.Insert Then
                CategoryData("Insert", strCategory, blnActive, blnCCDOnly, blnMMSOnly, strComments)
            End If
        Next
    End Sub

Attila Antal
Telerik team
 answered on 27 Dec 2023
0 answers
102 views
I have solved. Thanks.
Colin
Top achievements
Rank 1
Iron
 updated question on 26 Dec 2023
2 answers
155 views
Hello,

I would like not to export a ColumnGroups to Excel, if I simply make the columns that are part of the column group invisible it presents an error.

I really wish I didn't have ColumnGroups, as it doesn't make sense in my spreadsheet.

Thank you very much in advance
Attila Antal
Telerik team
 answered on 25 Dec 2023
2 answers
624 views
Hi!

I have issue with filter radGrid, when data in filter field contains double quotes ("). For example: <"Telerik" company>. In this case there is no filter action, and filter field cleaning after pressing on filter button.
This issue exist in online filter demo: http://demos.telerik.com/aspnet-ajax/Grid/Examples/GeneralFeatures/Filtering/DefaultCS.aspx
Try type in filter field some text with double quote and apply filter action. No filter will be apply and filter field will be clear.
There is workaround or fix for this issue?
Thank you.

P.S. Sorry for my English.


Vasko
Telerik team
 updated answer on 18 Dec 2023
1 answer
224 views

Injection vulnerability in RadButton

Our company is using HCL AppScan to expose possible security vulnerabilities. Recently, the scans have started returning issues of high severity related to Blind LDAP Injection because the parameters of the hidden ClientState for RadButtons, such as buttonAbort_ClientState, can be appended to affect the response.

The test uses the following logic:
Four requests are sent.
The last is logically equal to the originalThe next-to-last is different. Any others are for control purposes.A comparison of the last two responses with the first (the last is similar to it, and the next-to-last is different) indicates that the application is vulnerable.

These are not LDAP issues since LDAP is not implemented on the server but our security team in concerned this is a vulnerability because the parameter can be appended without sanitization.

Is there legitimate reason for concern? If so do you have any suggestions for remediation. We are using version 2023.1.323.45.

 Regards, Joel

Attila Antal
Telerik team
 answered on 14 Dec 2023
1 answer
92 views

Hello,

I have a master grid with multiple rows, each row has a detail grid (sub-grid).  I do not explicitly set Item Style and Alternate Item Style anywhere in the code and yet somehow items in the detail sub-grid displayed in alternating pattern (even rows with white background  and odd rows with light blue background), but items in the master grid do not have this alternating pattern and all have the same style.

Any idea why its different for master and details grid? How do I turn off Alternating Item Style for the entire grid?

Thanks,

Olga 

Vasko
Telerik team
 answered on 14 Dec 2023
3 answers
98 views

Hi,

I would like help with the following:

1. How can I modify the culture settings for a Box Plot Chart?

2. What steps are involved in changing the symbol from "$" to "£"?

Review the attached image for reference.

Best regards,
Omar

Vasko
Telerik team
 answered on 13 Dec 2023
0 answers
89 views

I have implemented a web application that uses the RadTabStrip and RadMultiPage.  The tabs and pages are dynamically created when the page is loaded.  I did not create a TabStrip_TabClick() callback and when I click on a tab, the tab's associated page shows up as expected - everything works fine!

Now I want to intercept the TabClick() callback in order to do some additional processing before the page is redisplayed.

When I add the TabClick() callback, clicking on a tab does not trigger the page to be displayed.

What basic code needs to be in the callback in order to trigger the default page load behavior?

protected void myTabStrip_TabClick(object sender, RadTabStripEventArgs e)
{
    // What
    // goes
    // here?
}
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 12 Dec 2023
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?