Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
Hi,

I have a problem that vertical bar shows whenever I popup the radwindow.  May anyone give some suggestions?

Thanks,

Duy
Shinu
Top achievements
Rank 2
 answered on 17 Mar 2010
3 answers
82 views
I'm using Publisher and I need to add an external image but can not. I click Image Editor I put the link, but it does not add. It only works if a file is on the server.

How do I do this?
Rumen
Telerik team
 answered on 17 Mar 2010
1 answer
131 views
Hi,

For the application I am working on, it would be very helpful if I could give my users a sort of 'limited' HTML editor to serve as a presentation template editor. What I would like them to be able to do is edit HTML and drag in database 'tokens' in a manner sort of like how images are dragged in in the example shown at: http://demos.telerik.com/aspnet-ajax/editor/examples/treeviewandeditor/defaultcs.aspx .. 

These tokens would correspond to field names that would act as placeholders. As a result, once a 'token' has been inserted, I don't want the user to be able to alter it since the user changing a character to the wrong thing could result in a mismatch where the intended database field is not found.

I wondered if anything like this is possible or you had come across any similar scenario. The only thing that I could think of doing would be to somehow track the start/stop positions of each token that had been placed in the editor, then track the cursor location when the user is using the editor and make the editor readonly when the cursor is 'inside' a token. However, I'm not quite sure how I would accomplish that, and I would still want to retain the ability to delete a token itself.

I hope that description makes sense.. Any help appreciated..
Rumen
Telerik team
 answered on 17 Mar 2010
1 answer
120 views
Hi
    I have a radgrid inline Add/Edit/Delete .When i click on the delete button it show the confirm message "Do you want to delete this Record?".But the corresponding row has not been selected.Even i have given AllowRowSelect="True" .

Example
                   I have 10 records in my grid.Default first row got selected when the page load.The user click on delete button at last Row
now the confirm message will show.But the user get confused which record will delete whether the First record or last record.

See the attachment.
                    First record is selected but i am deleting the last record.


Regards
Vairamuthu
Shinu
Top achievements
Rank 2
 answered on 17 Mar 2010
4 answers
232 views
Hi Team

I have a RadGrid with a Edit Form Setting of Template and a load of textboxes. Some of these have Requiredfield validator on them and this all works fine.

What I also need to do is a server side lookup on a value and not submit the data if that value exists. So I fill out my form, hit insert (its a new record) and if I single step the code it detects the duplicate value, but how do I then return to the radgrid, in insert mode, and show the error (I have a label control set to visible = false and want to show it.)

What is happening is the radgrid closes the form and I looses my data, and the label is never seen.

Andy
Princy
Top achievements
Rank 2
 answered on 17 Mar 2010
4 answers
554 views
Hello,telerik:

   As a beginner.I hava some questions:

1.In telerik grid,How to merge the same cell value among lots of rows?
2.Anthor question about RadWindow.
If a RadWindow is opend, how to fefresh the opener window by clicking the buttion in the opend window?

thanks.
songsp
Top achievements
Rank 1
 answered on 17 Mar 2010
5 answers
230 views
Hi,
I found that I could not edit the Self-referencing hierarchy and there is filtering bug in Self-referencing hierarchy too!Here is the video demo and my code:

http://www.youtube.com/watch?v=X_HrlJJSgko

<form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
    <div> 
        <asp:AccessDataSource ID="adsCategories" runat="server"   
            DataFile="~/App_Data/dbmx.mdb"   
            SelectCommand="SELECT * FROM [Categories] where isDelete = False"></asp:AccessDataSource> 
        <asp:AccessDataSource ID="adsProducts" runat="server"   
            DataFile="~/App_Data/dbmx.mdb"   
            SelectCommand="SELECT * FROM [Products] where isDelete = False"></asp:AccessDataSource> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="adsCategories"   
            GridLines="None" AllowFilteringByColumn="True" AllowPaging="True"   
            AutoGenerateEditColumn="True" Skin="Office2007">  
            <MasterTableView DataKeyNames="categoryID,categoryParentID" HierarchyLoadMode="Client" DataSourceID="adsCategories" HierarchyDefaultExpanded="False">  
                <SelfHierarchySettings KeyName="categoryID" ParentKeyName="categoryParentID" /> 
            <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            </MasterTableView> 
            <ClientSettings> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            </ClientSettings> 
        </telerik:RadGrid> 
    </div> 
    </form> 
Protected Sub RadGrid1_ColumnCreated(ByVal sender As ObjectByVal e As GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated  
        If TypeOf e.Column Is GridExpandColumn Then 
            e.Column.Visible = False 
        ElseIf TypeOf e.Column Is GridBoundColumn Then 
            e.Column.HeaderStyle.Width = Unit.Pixel(100)  
        End If 
    End Sub 
 
    Public Sub Page_Load(ByVal sender As ObjectByVal e As EventArgs) Handles MyBase.Load  
        If Assembly.GetAssembly(GetType(ScriptManager)).FullName.IndexOf("3.5") <> -1 Then 
            RadGrid1.MasterTableView.FilterExpression = "it[""categoryParentID""] = Convert.DBNull" 
        Else 
            RadGrid1.MasterTableView.FilterExpression = "categoryParentID IS NULL" 
        End If 
    End Sub 
 
    Public Sub Page_PreRenderComplete(ByVal sender As ObjectByVal e As EventArgs) Handles MyBase.PreRenderComplete  
        HideExpandColumnRecursive(RadGrid1.MasterTableView)  
    End Sub 
 
    Public Sub HideExpandColumnRecursive(ByVal tableView As GridTableView)  
        Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView)  
        For Each nestedViewItem As GridNestedViewItem In nestedViewItems  
            For Each nestedView As GridTableView In nestedViewItem.NestedTableViews  
                nestedView.Style("border") = "1" 
 
                Dim MyExpandCollapseButton As Button = DirectCast(nestedView.ParentItem.FindControl("MyExpandCollapseButton"), Button)  
                If nestedView.Items.Count = 0 Then 
                    If Not MyExpandCollapseButton Is Nothing Then 
                        MyExpandCollapseButton.Style("visibility") = "hidden" 
                    End If 
                    nestedViewItem.Visible = False 
                Else 
                    If Not MyExpandCollapseButton Is Nothing Then 
                        MyExpandCollapseButton.Style.Remove("visibility")  
                    End If 
                End If 
 
                If nestedView.HasDetailTables Then 
                    HideExpandColumnRecursive(nestedView)  
                End If 
            Next 
        Next 
    End Sub 
 
    Protected Sub RadGrid1_ItemCreated(ByVal sender As ObjectByVal e As GridItemEventArgs) Handles RadGrid1.ItemCreated  
        CreateExpandCollapseButton(e.Item, "categoryID")  
 
        If TypeOf e.Item Is GridHeaderItem AndAlso Not e.Item.OwnerTableView Is RadGrid1.MasterTableView Then 
            e.Item.Style("display") = "none" 
        End If 
 
        If TypeOf e.Item Is GridNestedViewItem Then 
            e.Item.Cells(0).Visible = False 
        End If 
    End Sub 
 
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As GridItemEventArgs) Handles RadGrid1.ItemDataBound  
        CreateExpandCollapseButton(e.Item, "categoryID")  
    End Sub 
 
    Public Sub CreateExpandCollapseButton(ByVal item As GridItem, ByVal columnUniqueName As String)  
        If TypeOf item Is GridDataItem Then 
            If item.FindControl("MyExpandCollapseButton"Is Nothing Then 
                Dim button As New Button()  
                AddHandler button.Click, AddressOf button_Click  
                button.CommandName = "ExpandCollapse" 
                button.CssClass = IIf((item.Expanded), "rgCollapse""rgExpand")  
                button.ID = "MyExpandCollapseButton" 
 
                If item.OwnerTableView.HierarchyLoadMode = GridChildLoadMode.Client Then 
                    Dim script As String = [String].Format("$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID)  
 
                    button.OnClientClick = script  
                End If 
 
                Dim level As Integer = item.ItemIndexHierarchical.Split(":"c).Length  
                If level > 1 Then 
                    button.Style("margin-left") = level + 10 & "px" 
                End If 
 
                Dim cell As TableCell = (DirectCast(item, GridDataItem))(columnUniqueName)  
                cell.Controls.Add(button)  
                cell.Controls.Add(New LiteralControl("&nbsp;"))  
                cell.Controls.Add(New LiteralControl((DirectCast(item, GridDataItem)).GetDataKeyValue(columnUniqueName).ToString()))  
            End If 
        End If 
    End Sub 
 
    Sub button_Click(ByVal sender As ObjectByVal e As EventArgs)  
        CType(sender, Button).CssClass = IIf((CType(sender, Button).CssClass = "rgExpand"), "rgCollapse""rgExpand")  
    End Sub 
louis chan
Top achievements
Rank 1
Iron
 answered on 17 Mar 2010
4 answers
239 views
Hi there,

I have a grouping grid and would like to insert something in the - I believe it would be the GridGroupSplitterColumn - of the individual items. I do not want to replace the Expand/Collapse images - I would like to use the space in the automatically created cell underneath the Expand/Collapse images (am I making sense here?)

Is this possible? Can someone point me in the right direction?
Thx in advance!
Rgds - Marcus.
Marcus
Top achievements
Rank 1
 answered on 17 Mar 2010
1 answer
59 views

 

The actual tool I am testing this on has 2 table views inside a rad grid.

On the last level I added an upload file feature.  But when the click event happens the RadUpload no longer has a file.  Even though I selected a file.

Here is what the aspx code looks like:
<
telerik:RadGrid ID="RadGrid1" ShowStatusBar="true" DataSourceID="ObjectDataSource1" runat="server" 

 

 

AutoGenerateColumns="False" PageSize="7" AllowSorting="True" AllowMultiRowSelection="False"  

 

AllowPaging="True" GridLines="None">

 

<PagerStyle Mode="NumericPages"></PagerStyle>

 

<MasterTableView DataSourceID="ObjectDataSource1"

 

DataKeyNames="PONumber" AllowMultiColumnSorting="True">

 

<DetailTables>

 

<telerik:GridTableView DataKeyNames="PurchaseOrderItemId" AutoPostBack="True" AllowAutomaticUpdates="true"

 

EditMode="InPlace" DataSourceID="ObjectDataSource2" Width="100%" runat="server">

 

<ParentTableRelation>

 

<telerik:GridRelationFields DetailKeyField="PONumber" MasterKeyField="PONumber" />

 

</ParentTableRelation 

 

<DetailTables>

 

<Columns>

<

 

telerik:GridBoundColumn SortExpression="DocumentTypeName" HeaderText="Document Type Name"

 

 

HeaderButtonType="TextButton" DataField="DocumentTypeName" UniqueName="DocumentTypeName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="DocumentFileName" HeaderText="File Name"

 

DataField="DocumentFileName">

 

 

<ItemTemplate>

 

<asp:HyperLink ID="hlFile" runat="server" Target="_blank" Text='<%# Bind("DocumentFileName") %>' /> 

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="ReplaceFileName" HeaderText="Replace File"

 

 

DataField="ReplaceFileName">

 

 

<ItemTemplate>

 

 

<telerik:RadUpload ID="FileUpload1" runat="server" MaxFileInputsCount="1" InitialFileInputsCount="1"

 

 

ControlObjectsVisibility="None" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Save" HeaderButtonType="TextButton" UniqueName="Save">

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnSave" runat="server" Text="Save" Width="80" ToolTip="Click here to save the new file."

 

 

OnClick="btnSave_Click" UseSubmitBehavior="False" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>
</

 

Columns>

 

 

</telerik:GridTableView>

 

</DetailTables>

 

<Columns>

 

<telerik:GridBoundColumn SortExpression="PONumber" HeaderText="PO Number" HeaderButtonType="TextButton"

 

DataField="PONumber" UniqueName="PONumber">

 

</telerik:GridBoundColumn>

 

<telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="Company Name" HeaderButtonType="TextButton"

 

 

DataField="CompanyName" UniqueName="CompanyName">

 

</telerik:GridBoundColumn>

 

</Columns>

 

</MasterTableView>

 

<ClientSettings>

 

<Selecting AllowRowSelect="true" />

 

</ClientSettings>

 

</telerik:RadGrid>

Here is the save function in cs:

 

protected

 

void btnSave_Click(object sender, EventArgs e)

 

 

{

 

 

GridDataItem item = (GridDataItem)((Button)sender).Parent.Parent;  

 

//PO Number works fine.
int
iPONumber = item.OwnerTableView.DataKeyValues[item.ItemIndex]["PONumber"] == DBNull.Value ? 0 : Convert.ToInt32(item.OwnerTableView.DataKeyValues[item.ItemIndex]["PONumber"]);

 

string sDocumentTypeName = item.OwnerTableView.DataKeyValues[item.ItemIndex]["DocumentTypeName"].ToString();

 

string sFileName = item.OwnerTableView.DataKeyValues[item.ItemIndex]["DocumentFileName"].ToString();

 

 

//This code finds the RadUpload but it no longer has the attached files when the Save button is clicked.
RadUpload
RadUpload1 = item.FindControl("FileUpload1") as RadUpload;

 


//This should have a count value of 1 for the 1 file I added.

 

 

 

if (RadUpload1.UploadedFiles.Count == 0)

{

// skips out if there are no files  

 

 

 

 

return;

}
//process the file if one exists.
}

 

 

Mark Match
Top achievements
Rank 1
 answered on 17 Mar 2010
4 answers
190 views
Hi. I'm using RadControls_for_ASP.NET_AJAX_2009_3_1314_dev. I have multiple RadToolBarDropDown's and RadToolBarButton's. When I change the font family the buttons aren't vertically aligned and appear all over the place. This doesn't happen with the default font that toolbar uses. Thanks.

.rtbText { fontnormal 11px verdanasans-serif !important; color#333333 !important; } 
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 16 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?