Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 views
Hello, I am using RadControls for ASP.NET AJAX version 2009.3.1314.20
My Horizontal TabStrip works fine in IE 7, 8, FF & Chrome but in IE 6 the width of each tab seems to be  Auto (100%) because the tabs stack vertically one above the other like they should for a vertical tabstrip. I inspected the CSS using IE Developer Tools and when I hover over the DIVs that hold each tab the highligh of the dv spans 100% of the container holding the tab control. I was hoping simply modifying the style to include a fixed width for the tabs and float them left  would fix this but either that doesn't work or I am not overriding the appropriate styles. Here is what I have tried but this doesn't work

.RadTabStrip .rtsLI
{
    PADDING-RIGHT: 0px;
    PADDING-LEFT: 0px;
    PADDING-BOTTOM: 0px;
    MARGIN: 0px;
    OVERFLOW: hidden;
    PADDING-TOP: 0px;
    LIST-STYLE-TYPE: none;
    width:100px !important;
    float:left;
}

.RadTabStrip .rtsLink
{
    TEXT-ALIGN: center;
    width:100px !important;
}

Any suggestions on how I can fix this issue?

Thanks in advance
Cliff
Ian
Top achievements
Rank 1
 answered on 14 Jul 2011
3 answers
136 views
HI,
I am trying to set the HeaderText property of the columns in a RadTreeList, however, it doesn't seem to respond to the following command:
tlCategories.Columns[0].HeaderText = common.RM.GetString("ctName");

The column's header stays empty.
If I use the HeaderText attribute in the aspx file it displays it correctly.

I am back to a previous issue I encountered with a GridView. Are these related? Any way around it?

By the way: the localization example on your deom site doesn't work at all: it fails to display localized resources and when I click on the related files link it gives me a no access error...

Any pointers would be greatly appreciated!
Viktor Takacs
Top achievements
Rank 2
 answered on 14 Jul 2011
1 answer
92 views
--- Disregard..  I found that the code pasted here does work, but I was setting the event in the page_init
RadGrid2.ItemCreated += new GridItemEventHandler(RadGrid2_ItemCreated);
which for some reason doesn't work.  Setting it on the aspx side:
OnItemCreated="RadGrid2_ItemCreated">
works..

Anyone know why defining the event in the code behind wouldn't work?

---

Hi,

Is there any way to change the widths of the textboxes that are created when you allow the grid to auto generate the edit template, without having to build a custom template?

Currently they all come out the same size, and half are too long and the other half are too short...

I tried code from a post with the same question, but it doesn't seem to do anything...

protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e)
        {
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
            {
                GridEditableItem edititem = (GridEditableItem)e.Item;
                TextBox txtbx = (TextBox)edititem["Donor_ID"].Controls[0];
                txtbx.Width = Unit.Pixel(50);
            }
  
        }


Thanks,

Matt
Vasil
Telerik team
 answered on 14 Jul 2011
2 answers
301 views
I have a screen that contains a Radgrid.  In this radgrid I have three filterTemplates that use a Radcombobox, and a GridNumericColumn for filtering.

It works fine when I filter on only one column but when I try want to filter by more than one it only filters on the current column.  I have changed the code behind to save the current filter and add the changes to it, the problem is I need to remove the existing filter and rebuild it based on the values from the selected filters.

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" EnableLinqExpressions="false"
                    PageSize="25" AutoGenerateColumns="False" GridLines="None" AllowSorting="True"
                    AllowFilteringByColumn="true" AlternatingItemStyle-BackColor="#eeeeee" ShowStatusBar="True"
                    OnItemCreated="RadGrid1_ItemCreated" OnPreRender="RadGrid1_PreRender" OnNeedDataSource="RadGrid1_NeedDataSource"
                    OnItemDataBound="RadGrid1_ItemDataBound" OnInsertCommand="RadGrid1_InsertCommand"
                    OnUpdateCommand="RadGrid1_UpdateCommand" Width="100%">
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                    <MasterTableView CommandItemDisplay="Top" DataKeyNames="AuditID" EditMode="InPlace">
                        <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="50px" />
                            <telerik:GridTemplateColumn HeaderText="Branch" DataField="CRDBranchNumber" SortExpression=""
                                UniqueName="CRDBranchNumber" HeaderStyle-Width="160px">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbBranch" DataTextField="CRDBranchNumber" DataValueField="CRDBranchNumber"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CRDBranchNumber").CurrentFilterValue %>'
                                        runat="server" AutoPostBack="true" OnSelectedIndexChanged="BranchCombo_SelectedIndexChanged" />
                                </FilterTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbCRDBranchNumber" Text='<%# Eval("CRDBranchNumber") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="rcbCRDBranchNumber" DataTextField="CRDBranchNumber" DataValueField="CRDBranchNumber"
                                        runat="server" Width="115px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="rcbCRDBranchNumber"
                                        ErrorMessage="*" runat="server" ToolTip="Branch is Required" InitialValue="Select Branch"
                                        ForeColor="Red" />
                                    <asp:Label runat="server" ID="ldID" Visible="false" Text='<%# Eval("CRDBranchNumber") %>' />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Auditor" DataField="AuditorName" SortExpression=""
                                UniqueName="AuditorName" HeaderStyle-Width="225px">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbAuditor" DataTextField="AuditorName" DataValueField="AuditorName"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AuditorName").CurrentFilterValue %>'
                                        runat="server" AutoPostBack="true" OnSelectedIndexChanged="AuditorCombo_SelectedIndexChanged" />
                                </FilterTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbAuditor" Text='<%# Eval("AuditorName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="rcbAuditor" DataTextField="AuditorName" DataValueField="AuditorID"
                                        runat="server" Width="175px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="rcbAuditor"
                                        ErrorMessage="*" runat="server" ToolTip="Auditor is Required" InitialValue="Select Auditor"
                                        ForeColor="Red" />
                                    <asp:Label runat="server" ID="ldAuditorID" Visible="false" Text='<%# Eval("AuditorID") %>' />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridNumericColumn DataField="AuditYear" HeaderText="Audit Year" SortExpression="AuditYear"
                                UniqueName="AuditYear" DataType="System.Decimal" DataFormatString="{0:F0}" />
                            <telerik:GridDateTimeColumn SortExpression="ScheduledDate" DataField="ScheduledDate"
                                HeaderText="Scheduled" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}"
                                AllowFiltering="false" HeaderStyle-Width="100px" UniqueName="ScheduledDate" />
                            <telerik:GridDateTimeColumn SortExpression="CompletedDate" DataField="CompletedDate"
                                HeaderText="Completed" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}"
                                AllowFiltering="false" HeaderStyle-Width="100px" UniqueName="CompletedDate" />
                            <telerik:GridTemplateColumn HeaderText="Status" DataField="Status" SortExpression=""
                                UniqueName="Status" HeaderStyle-Width="195px">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbStatus" DataTextField="Status" DataValueField="Status"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Status").CurrentFilterValue %>'
                                        runat="server" AutoPostBack="true" OnSelectedIndexChanged="StatusCombo_SelectedIndexChanged" />
                                </FilterTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblStatus" Text='<%# Eval("Status") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="rcbStatus" DataTextField="Status" DataValueField="AuditStatusID"
                                        runat="server" Width="150px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="rcbStatus"
                                        ErrorMessage="*" runat="server" ToolTip="Status is Required" InitialValue="Select Status"
                                        ForeColor="Red" />
                                    <asp:Label runat="server" ID="lbAuditStatusID" Visible="false" Text='<%# Eval("AuditStatusID") %>' />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn InsertText="Insert Audit" UpdateText="Update Audit" UniqueName="EditCommandColumn1"
                                CancelText="Cancel edit">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                </telerik:RadGrid>

Is there a way I can iterate through the columns, get the values of the selected filter and build a filter string.
Genti
Telerik team
 answered on 14 Jul 2011
2 answers
81 views
Hi All,

I have a Telerik grid placed in a usercontrol page.

In Internet Explorer everything is working fine,But in Firefox the columns are getting collapsed .
One column is coming above the other

Please help me its very urgent.
Radoslav
Telerik team
 answered on 14 Jul 2011
7 answers
82 views
hi, the problem im experiencing is regarding a checkbox enabled radtreeview with options
TriStateCheckBoxes="true"
CheckChildNodes="false"

The  rootnode (if no child nodes are selected) does successfully identify (and save) the checkstatus to the database by using:
the RadTreeView1.CheckedNodes method
and when I load the tree, I do in fact load the parent node that is checked, with the checked status

the problem is that when the tree is reloaded ,whilst it does identify that the parent node has a checked status, it does not physically put a check mark next to it on the client side ,although the node.checked  instruction definitely gets executed for the specific rootnode

e.g. of problem
Fruit
   - Strawberrys
   - Apples
Vegetables
  - Cauliflower
  - Pumpkin
Other

If i only select fruit, and not strawberries or apples, (thus only selecting the Fruit checkbox), then when the tree gets saved, and reloaded, the Fruit checkbox is not ticked, even though if you loop through the RadTreeView.CheckedNodes, the Fruit node actually says it does have the checked status, even though the Fruit node does not show the checked status on the front end

the outcome of the problem is thus that the user checks a rootnode, the tree gets reloaded in the backend, and then even though the tree knows (and the properties say) that the rootnode is checked, it does not show the user that the rootnode is checked

also in the ReloadTree event i created (listed below), even if i just instruct the (root)node to be checked, in the very next line the checkstate of the node is unchecked.

Also interesting, if i check a Rootnode which does not have childnodes ("Other" in the example), there is no problem, it saves and when the tree is populated, it loads the checkbox again, so this only happens if there are child nodes


any help? I have to redo a whole system if i cant get this to work
was this perhaps fixed in newer versions of radtreeview?

 

Protected Sub ReloadCreatedRADTree(ByVal tv As RadTreeView, ByVal dt As DataTable)
           
        Dim message As String = ""
        Dim nodeColletion As IList = tv.GetAllNodes
  
        For Each node As RadTreeNode In nodeColletion
                Dim iLoopDT As Integer
  
            For iLoopDT = 0 To dt.Rows.Count - 1
                Dim iBranchID As Integer = dt.Rows(iLoopDT)("BranchID")
                If node.Value = iBranchID Then
                    node.Checked = True
                    If node.Level = 0 Then
                        If node.CheckState = TreeNodeCheckState.Unchecked Then
                             'even though i just instructed the node to be checked,it still has unchecked status here
                        End If
                    End If
                End If
            Next iLoopDT
        Next node
    End Sub
Nikolay Tsenkov
Telerik team
 answered on 14 Jul 2011
3 answers
97 views
Hello,I have a problem,i want to get value of RadGrid2 but Radgrid2 in Radgrid1,i don't know how to get ID of radgrid with Button Click event
images : http://s1211.photobucket.com/albums/cc435/hieukenpro/?action=view&current=e.png
and this's my code
protected void Button1_Click(object sender, EventArgs e)
      {
          int count = 0;
          string sukien = "";
          string namhientai = "";           
          foreach (GridDataItem item in (How to get ID of RadGrid2 in this Event ?).SelectedItems)
          {
              foreach (GridColumn column in item.OwnerTableView.RenderColumns)
              {
                  if (count == 1 || count == 2)
                  {
                      if (count == 1)
                          sukien = item[column.UniqueName].Text.ToString();
                      if (count == 2)
                          namhientai = item[column.UniqueName].Text.ToString();
                  }
                  count++;
              }
          }
      }
Please Help Me

Thanks,
Trung Hiếu
Mira
Telerik team
 answered on 14 Jul 2011
1 answer
159 views
I have a combobox that has numbers and alpha in the same list.  I need ALL to be the first choice but when I put ascending as a sort option the numbers are above the words.  Example below:

3rd Party
2 Board
ALL
Blade
Cards
Video

Is there a way to get ALL to the top so it looks like this. (See Below)  The choices are being filled from a datasource except for ALL which is being added by using the AppendDataBoundItems= True and Text = ALL
ALL
3rd Party
2 Board
Blade
Cards
Video

Princy
Top achievements
Rank 2
 answered on 14 Jul 2011
6 answers
118 views
I specified the user control on the grid to call for update/insert/delete,  

It seems that when I click the Insert button it does call the form, but once clicking the form SUBMIT button (itemcommand = Update) , it returns to the Radgrid1_UpdateCommand()  instead of the RadGrid1_InsertCommand 


what did I do wrong

seems that once the usercontrol is called, it sets as a UPDATE instead of INSERT... 

Iana Tsolova
Telerik team
 answered on 14 Jul 2011
1 answer
67 views
Good morning, dear Telerik wizards,

Simple scenario.. RadGrid showing fine. On particular context menu click, opening via popup one of a number of DIFFERENT edit user controls. For example:
RGVMyTasksAll.MasterTableView.EditFormSettings.UserControlName = "MemberITaskDelete.ascx";
RGVMyTasksAll.MasterTableView.EditFormSettings.PopUpSettings.Width = 400;
sEditTUID = RGVMyTasksAll.Items[radGridClickedRowIndex].Cells[2].Text;
tName = RGVMyTasksAll.Items[radGridClickedRowIndex].Cells[4].Text;
RGVMyTasksAll.MasterTableView.EditFormSettings.CaptionFormatString = "Deleting Task: " + tName.ToUpper();
RGVMyTasksAll.Items[radGridClickedRowIndex].Edit = true;
ck = new HttpCookie("ITID", sEditTUID);
Response.Cookies.Add(ck);
RGVMyTasksAll.MasterTableView.AllowAutomaticInserts = false;
RGVMyTasksAll.MasterTableView.AllowAutomaticUpdates = false;
RGVMyTasksAll.Rebind();
break;
Probably don't need all of those lines in there... but when the Rebind is executed,the user control pops up just fine. This particular one is focussed on gathering adequate permissions before delete of task is authorized. Delete in this case is NOT a delete of record, but a change of status of a record... so it is really an update.

When done, I get the popup to go away by:
RadGrid rg = (RadGrid)CMFinds.FindControl(p, "RGVMyTasksAll");
rg.AllowAutomaticInserts = false; rg.AllowAutomaticUpdates = false; rg.AllowAutomaticDeletes = false;
rg.MasterTableView.AllowAutomaticInserts = false; rg.MasterTableView.AllowAutomaticUpdates = false; rg.MasterTableView.AllowAutomaticDeletes = false;
rg.MasterTableView.IsItemInserted = false;
rg.MasterTableView.ClearChildEditItems();
rg.Rebind();
My own (better for many complex situations) recursive Find Control locates the calling grid... again not sure that I need all the lines... but it closes, delete (which is change of state) is accomplished earlier, all is well.

Problem: Next time I come in to do another delete, the popup user control contains the data from the PRIOR delete, not the current one.

So two questions:
1. How can I make sure the edit control either unloads inbetween calls or resets the data properly? Important
2. What can I delete from this code as unnecessary? Just out of curiosity.

Thanks.
Chris

Mira
Telerik team
 answered on 14 Jul 2011
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?