Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
95 views
Hello,
I have a gridview like,
<telerik:RadGrid ID="RadGrid1" GridLines="None" Width="485" ShowGroupPanel="false"
                AllowFilteringByColumn="true" runat="server" CellSpacing="0" AutoGenerateColumns="false"
                OnItemDataBound="RadGrid1_ItemDataBound" AllowSorting="true">
                <ClientSettings AllowDragToGroup="true" AllowRowsDragDrop="true" AllowAutoScrollOnDragDrop="true"
                    AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowColumnsReorder="True"
                    Animation-AllowColumnRevertAnimation="true" ColumnsReorderMethod="Reorder" Animation-AllowColumnReorderAnimation="true">
                    <ClientEvents OnRowDblClick="RowDblClick" />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
                <MasterTableView ShowGroupFooter="false" AllowMultiColumnSorting="true" EnableHeaderContextMenu="true"
                    GroupsDefaultExpanded="false">
                    <Columns>                      
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                            Visible="true" UniqueName="Name">
<telerik:GridBoundColumn DataField="userType" HeaderText="Type" SortExpression="userType"
                            Visible="true" UniqueName="userType">
                        </telerik:GridBoundColumn>                       
                        <telerik:GridTemplateColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                            UniqueName="Address">
                            <ItemTemplate>
                                <asp:Label ID="lblVersion" runat="server" Text='<%#Eval("Address") %>'>
                                </asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>                      
                        <telerik:GridTemplateColumn DataField="attachment" AllowFiltering="false" Display="false"
                            UniqueName="attachment">
                            <ItemTemplate>
                                <asp:Label ID="hfattachment" runat="server" Text='<%#Eval("attachment") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="Name" />
                                <telerik:GridGroupByField FieldName="Type" />                            
                            </GroupByFields>
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="File_Name" HeaderText="Name   " />                               
                            </SelectFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                </MasterTableView>
                <GroupingSettings ShowUnGroupButton="false" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
----------------------

I have dabble click option here, when I dabble click a row it show it's attachment....
dabble click function is...

<script type="text/javascript">


            function DownloadFile(filepath) {
                alert(filepath);
                window.open(filepath, '_blank', 'top=200, left=250,height=400,width=700,status=yes,toolbar=no,menubar=no,location=yes,resizable=yes');
            }    

            function RowDblClick(sender, eventArgs) {
                var rowIndex = eventArgs.get_itemIndexHierarchical();
                var grid = $find("<%=RadGrid1.ClientID %>");

                var masterTableView = grid.get_masterTableView();
                var item = masterTableView._dataItems[rowIndex];
                var items = eventArgs.get_gridDataItem();
                var Element = items._element;
                if (Element) {
                    var keyValues = Element.cells[3].innerText;
                    alert(keyValues);
                    DownloadFile(keyValues);                           
                }
            }
    
        </script>

------------------------
Everything is good here for other browser but, when I run the application with safari (i am using 5.0.1) then it take also my localhost address ( like- http://localhost:53809/myapp/%20%20%20http://www.mydomain.com/myfile.doc)
any one please tell me why this is happening ?
Marin Bratanov
Telerik team
 answered on 08 Feb 2012
5 answers
876 views
Please help. I have one column in each row of my radgrid  in which i want to show an image. I am  getting values from database reading 1 or 2 for that particular column and for each of these values i want to show different images for different values. For example if i am getting 1 from database I want to show a particular image and for 2 i want to show a different image. Right now I am hardcodeing the red_circle image as I have not incorporated the database logic. So as of now when I click the imagebutton it is working as intended(it changes the image from red to green or green to red) I just need to figure out how to dynamically tell it which image to load depending on database column value of 1 or 2.
Thanks!

--aspx code

<

Columns>

 <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="False">

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn DataField="NAME" HeaderText="NAME" SortExpression="NAME" UniqueName="NAME">

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn DataField="TITLE" HeaderText="TITLE" SortExpression="TITLE" UniqueName="TITLE">

 </telerik:GridBoundColumn>

 <telerik:GridTemplateColumn HeaderText="STATUS" UniqueName="STATUS">

 <ItemTemplate>

 <asp:ImageButton ID="lnkStatus" runat="server" ImageUrl = "\Images\circle_red.png" CommandName="StatusChange" CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>

 </ItemTemplate>

 </telerik:GridTemplateColumn>

 </Columns>

 
--.vb code

 Protected Sub gvStaff_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvStaff.ItemCommand

 

If e.CommandName = "StatusChange" Then

If TypeOf e.Item Is GridDataItem Then

  

Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

Dim statusButton As ImageButton = DirectCast(item("STATUS").FindControl("lnkStatus"), ImageButton)

statusButton.ImageUrl = "\Images\circle_green.png"

 End If

 End If

 End Sub

 

Antonio Stoilkov
Telerik team
 answered on 08 Feb 2012
1 answer
64 views
Hi.

In monthview the name of the month that is displayed in the header. This is always right even if the first day in the view is from the previous month.
I need to get this! 
VisibleRangeStart.Month gets the previous month, and selecteddate.month looks random.

I need this because I am creating a MonthPlan as a pdf that starts on the first monday of the Month. This is created from the displayed month. I can find the first monday, but I need to be on the correct month.

Please help.
Ivana
Telerik team
 answered on 08 Feb 2012
1 answer
106 views
has anyone used social share with Umbraco? I have it working but I was wondering if anyone new how to auto assign the urltoshare property based on the current page. There is an umbraco tag for the current page ($current_page/@id), but when I try and insert this into the property UrlToShare I get an invalid id.
Marin Bratanov
Telerik team
 answered on 08 Feb 2012
1 answer
79 views
Hi,
I'm trying to create a webapp that would allow me to drag rows from a GridView into a DockZone creating a new dock object at each drop of a row (whether on the Client or Server side), but I can't find any information on its feasibility.
Did someone ever try that kind of scenario ?

Cheers

Chris
Slav
Telerik team
 answered on 08 Feb 2012
1 answer
194 views
hi

My menu is bound to a sqldatasource and i would to disable the autopostback on the parent item.

I know the parent item autopostback can be disable when you build your menu manually but how do i do so when my menu is data bound to a sqldatasource? Thanks
Kate
Telerik team
 answered on 08 Feb 2012
1 answer
67 views
Hello, 

I am rendering an asp:panel and putting the html into the content of a RadEditor before exporting a pdf. 

Sometimes only header tags show up on the pdf, and the tables do not appear, but sometimes they do appear. 

If I debug and check the RadEditor content before calling ExportToPdf all of the HTML for the tables are present, but for some reason they do not appear in the PDF. 

Any ideas?
Rumen
Telerik team
 answered on 08 Feb 2012
1 answer
148 views
Hi,

I'm running the latest version of Telerik Controls and am hooking up a RadFilter to a RadGrid. When I have a GridCalculatedColumn set up as "Filterable" on my grid, the RadFilter displays duplicate items for that column. When I turn off filtering for that column, it removes both items from the filter. I've attached an image as an example.

<telerik:GridCalculatedColumn  DataFields="GetPercent" UniqueName="GetPercent" HeaderText="Tarpon Get %" Expression="{0}/100" Aggregate="Avg" Display="false" DataFormatString="{0:P0}" DataType="System.Double" />


Is this a bug in the RadFilter? Or is there a way of preventing this duplication while still being able to filter on those columns?

Thanks,
Landon
Mira
Telerik team
 answered on 08 Feb 2012
2 answers
99 views
Hi,
I would like to Insert child item on ItemDataBound event.
My code:
If TypeOf e.Item Is TreeListDataItem Then
            Dim dataItem = DirectCast(e.Item, TreeListDataItem)
            If dataItem.HierarchyIndex.NestedLevel <> 0 Then
                dataItem("InsertCommandColumn").Controls(0).Visible = False
            End If
            dataItem("FileName").Text = ""
            dataItem("VisitName").Text = ""
            'dataItem.InsertChildItem()
        End If

<Columns>
                            <telerik:TreeListEditCommandColumn UniqueName="InsertCommandColumn" ButtonType="ImageButton"
                                HeaderStyle-Width="60px" ItemStyle-HorizontalAlign="Center" InsertText="Create Subject" />
                            <telerik:TreeListTemplateColumn AllowSorting="false" ItemStyle-Width="140px" HeaderStyle-Width="140px">
                                <ItemTemplate>
                                    <telerik:RadButton ID="btnCancel" Text="Upload" runat="server" CausesValidation="False"
                                        CommandName="UploadFiles" CommandArgument='<%# Bind("Patient_Id") %>'>
                                        <Icon PrimaryIconUrl="~/Images/upload16X16.png" PrimaryIconLeft="5px" />
                                    </telerik:RadButton>
                                </ItemTemplate>
                            </telerik:TreeListTemplateColumn>
                            <telerik:TreeListBoundColumn DataField="ClientPatient_Id" HeaderText="Subject ID"
                                ReadOnly="true" UniqueName="ClientPatientId" HeaderStyle-Width="60px" ForceExtractValue="Always" />
                            <telerik:TreeListBoundColumn DataField="FileName" HeaderText="File Name" UniqueName="FileName"
                                HeaderStyle-Width="300px" />
                            <telerik:TreeListBoundColumn DataField="Visit_Name" HeaderText="Visit" UniqueName="VisitName"
                                HeaderStyle-Width="60px" />
                            <telerik:TreeListBoundColumn DataField="CreationDate" HeaderText="Date Created" UniqueName="CreationDate"
                                HeaderStyle-Width="60px" DataFormatString="{0:d}" />
                        </Columns>

Thank you for the help.
Valdas
Top achievements
Rank 1
 answered on 08 Feb 2012
2 answers
104 views
Hello

I have a RadGrid and use the page size as a paging option.  If my grid has less than 25 records in the search result, then no navigation bar is displayed - This is okay, as I don't need it at this point.  However if I have more than 25 results, but less then 50 results, and I change my page size to 50; the grid will show all results, but the navigation bar is no longer displayed.  This means that I am no longer able to change the page size back to 25 without having to reload the whole page.

Is it possible to force the navigation bar to always display?

Many thanks,

Mark
Mark
Top achievements
Rank 1
 answered on 08 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?