Telerik Forums
UI for ASP.NET AJAX Forum
20 answers
499 views
Hello,

I recently downloaded and upgraded our website with the latest release 2013.1.220.40 and seem to only be having one issue that I came accross.  For some reason, all of the RadTextBox controls no longer are respecting the Width property when set to a %, instead they only seem to repect the Width when set in pixels.

Has something changed with the controls and caused the Width to no longer work for percentages?  I also tried setting the width via CSS to see if it would work and it did to an extent.  Once I did that, the textbox was much longer than it's parent container to the point where even setting margin-right to -1000px on a DIV to wrap it still did not prevent the textbox from overflow.

Currently the html looks like so:
<div class="fix-100">
<telerik:RadTextBox ID="NewRole" runat="server" Width="100%"
EmptyMessage="enter new role to add..." />
</div>

The wrapping DIV with the class of "fix-100" is what I usually wrap around all my RadTextBoxes that I normally set to 100%.  The CSS for that class simply sets margin-right to -4px as it seems the RadTextBox at 100% is slightly longer than it should be.

Additionally, I downgraded the controls back to version 2012.3.1308.40 and the problem went away and the RadTextBoxes were respecting the width when set in % again.

I appreciate any help.

Thanks,
Ron
Mahdy
Top achievements
Rank 1
 answered on 08 Jan 2014
10 answers
1.0K+ views
I have a grid that has a GridDateTimeColumn, and I'm trying to apply a default filter on page load.  I do have the AllowFiltering property set to true on the column, as well as the grid itself and I've also set the current filter condition [this part works].  I have a data source that is loaded with a large date range, but the users are requesting to hide most of the data so it's available for searching.  I've tried following this example: http://www.telerik.com/community/forums/aspnet-ajax/grid/default-filter-on-initial-load-for-griddatetimecolumn-with-rangefiltering.aspx but it didn't apply the filter - it just fills the date in the filter box.

I should also note, that I am trying to apply the filter in my code-behind.
private void LoadInfo(bool forceBind = true)
{
    radJobPostings.DataSource = JobPosting.LoadVAllJobPostings(user_id, _defaultFromDate);  //_defaultFromDate = Today - 3 years
    if (forceBind)
    {
        radJobPostings.MasterTableView.GetColumn("PostedDate").CurrentFilterValue = DateTime.Today.AddDays(-180).ToShortDateString();
        radJobPostings.DataBind();
    }
}
Mike
Top achievements
Rank 1
 answered on 08 Jan 2014
3 answers
312 views
Hello,

I have the exact same issue reported over two years ago here - http://www.telerik.com/community/forums/aspnet-mvc/combobox/dropdownlist-does-not-change-its-input-value.aspx

Using the plugin they are also using, I have found changes to dropdowns were not being tracked.  I believe the root of this issue is from this user's post:

"However, using .val() does not fire a change event. In html's select dropdown and not telerik's dropdown, selecting a different value fires a change event. In your case, you change the value via .val() but forget to trigger a change event which I think you should do via $('#').val().change();"

Telerik's reply back in sept 2011 was that this would be forwarded to the developers.  I am not interested in wiring up a valueChanged event handler to every dropdownlist, and was hoping to get an update on this issue.  Shouldn't telerik's dropdown follow the same event pattern as a standard html dropdown in terms of firing events?  If there's a reason it shouldn't, is there any global solution for this issue?


Nencho
Telerik team
 answered on 08 Jan 2014
6 answers
113 views
I have a self-referencing hierarchical grid defined as follows:

<telerik:RadGrid
    ID="grdNotes"
    runat="server"
    OnColumnCreated="grdNotes_ColumnCreated"
    OnItemCreated="grdNotes_ItemCreated"
    OnItemDataBound="grdNotes_ItemDataBound"
    OnNeedDataSource="grdNotes_NeedDataSource"
    OnPreRender="grdNotes_PreRender"
    AutoGenerateColumns="False"
    SkinID="HierarchicalGrid"
    GridLines="None"
    AllowCustomPaging="True"
    ShowStatusBar="True"
    PageSize="20"
    EnableLinqExpressions="False"
    Width="99%" CellSpacing="0">
    <MasterTableView
        HierarchyDefaultExpanded="true"
        HierarchyLoadMode="Client"
        AllowSorting="true"
        DataKeyNames="Id,ParentId,Token,IsRoot,Replies,NoteCreator"
        ClientDataKeyNames="Id,ParentId,Token,IsRoot,Replies,NoteCreator"
        NoDetailRecordsText=""
        EnableNoRecordsTemplate="False"
        TableLayout="Auto"
        Width="100%"
        HorizontalAlign="Right"
        EnableHeaderContextMenu="True">
        <SelfHierarchySettings ParentKeyName="ParentId" KeyName="Id" MaximumDepth="20" />
        <RowIndicatorColumn Visible="False" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
        <Columns>
            <telerik:GridClientSelectColumn DataTextField="Id" HeaderAbbr="Select" HeaderButtonType="TextButton"
                HeaderText="Select" HeaderTooltip="Select/Deselect" Text="Select" Visible="false"
                UniqueName="asgSelect">
            </telerik:GridClientSelectColumn>
            <telerik:GridBoundColumn DataField="Id" SortExpression="Id" UniqueName="Id">
                <HeaderStyle Width="50px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Title" SortExpression="Title" UniqueName="Title"
                HtmlEncode="true">
                <HeaderStyle Width="150px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Body" SortExpression="Body" UniqueName="Body" HtmlEncode="False">
                <HeaderStyle Width="350px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CreatedBy" SortExpression="CreatedBy" UniqueName="CreatedBy">
                <HeaderStyle Width="150px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CreatedDate" SortExpression="CreatedDate" UniqueName="CreatedOn">
                <HeaderStyle Width="150px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ParentId" HeaderText="Parent Id" SortExpression="ParentId"
                UniqueName="ParentId" Visible="false" />
            <telerik:GridBoundColumn DataField="Token" HeaderText="Token" SortExpression="Token"
                UniqueName="Token" Visible="false" />
            <telerik:GridBoundColumn DataField="IsRoot" HeaderText="Is Root" SortExpression="IsRoot"
                UniqueName="IsRoot" Visible="false" />
            <telerik:GridBoundColumn DataField="Replies" HeaderText="Replies" SortExpression="Replies"
                UniqueName="Replies" Visible="false" />
            <telerik:GridBoundColumn DataField="NoteCreator" HeaderText="NoteCreator" SortExpression="NoteCreator"
                UniqueName="NoteCreator" Visible="false" />
            <telerik:GridTemplateColumn UniqueName="Actions" Visible="false">
                <ItemTemplate>
                    <telerik:RadToolBar ID="rtbNoteActions" runat="server" SkinID="ActionToolbar" OnButtonClick="NotesGridToolbarButtonClicked"
                        OnClientButtonClicking="NoteActionToolbarClicking">
                        <Items>
                            <telerik:RadToolBarButton Text="Properties" CommandName="Properties" ImageUrl="~/Images/page_view.gif" />
                            <telerik:RadToolBarButton Text="Reply" CommandName="Reply" ImageUrl="~/Images/page_edit.gif" />
                            <telerik:RadToolBarButton Text="Security" CommandName="Security" ImageUrl="~/Images/shield16.gif" />
                            <telerik:RadToolBarButton Text="Delete" CommandName="Delete" ImageUrl="~/Images/delete16.gif" />
                        </Items>
                    </telerik:RadToolBar>
                </ItemTemplate>
                <HeaderStyle Width="15%"></HeaderStyle>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
        <PagerStyle AlwaysVisible="True"></PagerStyle>
    </MasterTableView>
    <HeaderContextMenu EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </HeaderContextMenu>
    <ExportSettings ExportOnlyData="True" IgnorePaging="True">
    </ExportSettings>
    <ClientSettings
        Selecting-AllowRowSelect="true"
        Resizing-AllowColumnResize="true"
        AllowColumnsReorder="true">
        <Selecting AllowRowSelect="True"></Selecting>
        <ClientEvents
            OnRowSelected="NoteRowSelected"
            OnRowContextMenu="NoteContextMenu"
            OnRowDblClick="grdNotes_OnRowDblClick"
            OnGridCreated="NotePageLoad"
            OnTableCreated="ResizeAllNoteColumns"
            OnColumnResized="ResizeAllNoteColumns"
            OnColumnHiding="HideDetailColumn"
            OnColumnShowing="ShowDetailColumn" />
    </ClientSettings>
    <PagerStyle Position="Bottom" AlwaysVisible="True" Mode="NextPrevAndNumeric" Wrap="False"
        BackColor="White" Font-Size="Large" />
</telerik:RadGrid>


Each item can have 0 or more children.  When I reorder the columns, the root level entries (indicated as "Parent Col Val" below) are reordered, but the child column values (e.g., "Child Col Val") remain in the order in the grid defintion.  For example, if I have the initial layout defined as:

Col A        | Col B        | Col C
Parent A Val | Parent B Val | Parent C Val
Child A Val  | Child B Val  | Child C Val
Child A Val  | Child B Val  | Child C Val
Parent A Val | Parent B Val | Parent C Val

I then reorder the columns.  While the parent values reorder properly, the child ones do not.

Col B        | Col A        | Col C
Parent B Val | Parent A Val | Parent C Val
Child A Val  | Child B Val  | Child C Val
Child A Val  | Child B Val  | Child C Val
Parent B Val | Parent A Val | Parent C Val

This also occurs when I the saved grid settings are reloaded during Page_init (e.g., the parent items are ordered in the saved order, but the child columns are ordered as they're defined).  Attached are screenshots showing the grid before and after the columns are reordered to better describe the behavior I'm experiencing.

Is this a bug w/ the grid?  I would expect that self-referencing grids would automatically reorder the child tables as well.  If this isn't a bug, what is required in order for the columns to be ordered properly?
Matt
Top achievements
Rank 1
 answered on 08 Jan 2014
3 answers
270 views
Hi,
I have a 2 Level(Parent & Child) Treeview.
and i set Parent Node ExpandMode = TreeNodeExpandMode.ServerSide;

How do we set Checked=true if user has previously selected Child nodes (lets assume i am getting the previous selected values from the Database)


Thank you
Plamen
Telerik team
 answered on 08 Jan 2014
1 answer
72 views

Followup: Found this:

http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-hierarchical.html



which answered my question, and was able to resolve my issue.



Sometimes, admittedly, I am not the brightest bulb on the planet, but for the life of me I just can't seem to get what I think is a rather simple TreeView to work.


I have data from an SQL data source which is broken down into categories, i.e.







ID              Text                    ParentId
-----------------------------------------------------------
Header                                  Header
Preamble                                Preamble
Clauses                                 Clauses
            Administrative Fees     Clauses
            Prompt Delivery         Clauses
Signature Block                         Signature Block
Appendix                                Appendix
Exhibit                                 Exhibit








Basically, I want this to appear in a tree view with the "Id" Text being the primary (expandable) node (i.e. Clauses), and the "text" being the secondary node which will appear when the user expands the primary node.







I've fiddled around w/ the various online examples, but either I get an error telling me "These columns don't currently have unique values" (if I leave the ParentId column blank when the Text column is blank) or I get nothing at all. I've tried duplicating the online example:







<telerik:RadTreeView runat="server" ID="RadTreeView1" DataSourceID="SqlDataSource1"
DataFieldID="id" DataFieldParentID="parentID" Skin="Vista" CheckBoxes="true">
    <DataBindings>
        <telerik:RadTreeNodeBinding TextField="Text" />
        <telerik:RadTreeNodeBinding
            Depth="0"
            Checkable="false"
            TextField="Text"
            Expanded="true"
            CssClass="rootNode"
        />
    </DataBindings>
</telerik:RadTreeView>








but without "seeing" the underlying data, I'm not sure how to structure my dataset to duplicate this functionality.







Can someone provide a simple example of the proper TreeView syntax?











Dimitar
Telerik team
 answered on 08 Jan 2014
4 answers
104 views
Trying to export my sub grid as well but it seems to not work, following the instructions found on teleriks sites but to no avail.

Mu grid is wrapped in update panel and it works to export the main grid just fine just no sub grids come along.  Here is the code I put in to take care of the issue but nothing.  I am using all the radgrid advanced data binding methods.

<CommandItemTemplate>
           <asp:Button ID="btnExport" runat="server" CommandName="ExportToExcel" Text="Export Excel" />
</CommandItemTemplate>
 
  Protected Sub myRadGrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles myRadGrid.ItemCommand
        If e.CommandName = "ExportToExcel" Then
            For Each item As GridItem In myRadGrid.MasterTableView.Items
                item.Expanded = True
            Next
            isExport = True
        End If
    End Sub
 
 
 Protected Sub myRadGrid_ItemCreated(sender As Object, e As GridItemEventArgs) Handles myRadGrid.ItemCreated
        If Not isExport Then
            If TypeOf e.Item Is GridCommandItem Then
                ScriptManager.GetCurrent(Page).RegisterPostBackControl(e.Item.FindControl("btnExport"))
            End If
        End If
    End Sub


Kevin
Top achievements
Rank 1
 answered on 08 Jan 2014
4 answers
56 views
Hi,
I would like to set 'Auto' width of grid.. because my Page contains left sidebar with hide and show functionality and I have grid with 15 columns.
When I bind the data to grid with '100%' width, it goes outside of design and If I set specific width to grid then it not display properly b'coz of the side bar hide and show functionality.
If same grid contain less column then it works properly..so please give me proper solution.
thank you.
Galin
Telerik team
 answered on 08 Jan 2014
1 answer
88 views
Hi - 
I'm looking for suggestions on how to best achieve the following using the AsyncUpload control.

Our users are uploading excel files. I need to verify there are certain columns in the excel file. If they are all present, then it will pull data from the spreadsheet and put that into a database. Then the file itself will be put into the database.

At what point should I do the verification for the columns? Can I do this error checking on the temporary file?  There is no reason for the excel file to ever make it into the database if the columns are not present and the data cannot be uploaded if it isn't.

Thank you in advance.
Plamen
Telerik team
 answered on 08 Jan 2014
1 answer
86 views
Hi,

I am creating a new dashboard page with RadTabstrips and each tabs loading an individual set of Raddocks dynamically (these docks are movable and thier state are saved in the DB).
The issue we are facing while trying to achieve this is since we are loading the Docks dynamically and maintainig its state through docklayout's loadstate and savestate method, we are suppose to add the dock back in Page_Init event.
Also we can get the required dock details from DB based on current selected Tab only but we cannot get the selected tab index in Page_Init. If we get the selected index in page_load and add docks there then the state of the dock is not retained.

Please suggest us a solution here, following are some of the code samples;
Dashboard.aspx:

<telerik:RadTabStrip runat="server" ID="RadTabStrip1" class="Dashboard" Orientation="HorizontalTop" EnableDragToReorder="true" OnTabClick="RadTabStrip1_TabClick" Skin="Outlook" OnReordered="RadTabStrip1_Reordered" MultiPageID="RadMultiPage1" OnClientTabSelecting="onClientTabSelecting" SelectedIndex="0">
                            </telerik:RadTabStrip>
                
       
        <telerik:RadMultiPage class="Dashboard" ID="RadMultiPage1" runat="server" Width="100%" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated">
            <telerik:RadPageView ID="RadPageView1" runat="server">
                <asp:Panel ID="Panel1" runat="server" BorderStyle="None" Width="100%">
                    <telerik:RadDockLayout runat="server" ID="RadDockLayout1"  OnSaveDockLayout="SaveDockLayout1_LoadDockLayout" StoreLayoutInViewState="true">
                        <telerik:RadDockZone runat="server" ID="LeftZone" BorderStyle="Solid" BorderWidth="0px" BorderColor="White" Width="25%" MinHeight="450px" Style="float: left; margin-right: 1px" Height="100%" Skin="Windows7">
                       
                         
                        </telerik:RadDockZone>
                        <telerik:RadDockZone runat="server" ID="MiddleZone" BorderStyle="Solid" BorderWidth="0px" BorderColor="Gray" Width="47%" MinHeight="450px" Style="float: left; margin-right: 1px" Height="100%" Skin="Windows7">
                       
                        </telerik:RadDockZone>
                        <telerik:RadDockZone runat="server" ID="RightZone" BorderStyle="Solid" BorderWidth="0px" BorderColor="White" Width="25%" MinHeight="450px" Style="float: left; margin-right: 1px" Height="100%" Skin="Windows7">
                        </telerik:RadDockZone>
                        <br style="clear: both;" />
                    </telerik:RadDockLayout>
                </asp:Panel>
            </telerik:RadPageView>
        </telerik:RadMultiPage>

Dashboard.aspx.cs:

protected

 

 

void Page_Init(object sender, EventArgs e)

 

{

RadDockLayout1.LoadDockLayout+=

 

new DockLayoutEventHandler(RadDockLayout1_LoadDockLayout);

 

AddDocksByPosition(0);

 


}

private void AddDefaultDocks(int position)

 

{

/*** Get list of docks from DB and load it to the Docklayout****/
}

protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)

 

{

 

System.Web.Script.Serialization.

 

JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

 

 

 

string serializedList = DockPostionstr;

 

 

 

if (!string.IsNullOrEmpty(serializedList))

 

{

 

 

string[] states = serializedList.Split('|');

 

 

 

foreach (string stringState in states)

 

{

 

 

if (stringState != string.Empty)

 

{

 

 

DockState state = serializer.Deserialize<DockState>(stringState);

 

e.Positions[state.UniqueName] = state.DockZoneID;

e.Indices[state.UniqueName] = state.Index;

}

}

}

}


 

 

 

protected void SaveDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)

 

{

 

 

string dockState;

 

System.Web.Script.Serialization.

 

JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

 

 

 

List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();

 

 

 

StringBuilder serializedList = new StringBuilder();

 

 

 

int i = 0;

 

 

 

while (i < stateList.Count)

 

{

serializedList.Append(serializer.Serialize(stateList[i]));

serializedList.Append(

 

"|");

 

i++;

}

dockState = serializedList.ToString();

/***** DB call to save Dashboard state per Tab******/
}

Slav
Telerik team
 answered on 08 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?