Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
253 views
hi,

I have create a rad panel as below and for the RadPanelBar with the ID "rpbIncludeSections" items are added dynamically.
<telerik:RadPanelBar runat="server" ID="rpbResumeSections" Width="300px" GridLines="Horizontal" >
        <Items>
            <telerik:RadPanelItem ID="rpiResumeSections" runat="server" PreventCollapse="false" Expanded="true" >
                <Items>
                    <telerik:RadPanelItem ID="rpbResumeSectionInfo" runat="server" >
                        <HeaderTemplate>
                            <div style="margin: 10px;">
                                <telerik:RadComboBox runat="server" ID="rcbTemplates" Width="250px" AutoPostBack="true"  OnSelectedIndexChanged="rcbTemplates_OnSelectedIndexChanged"></telerik:RadComboBox>
                            </div>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <!--Dynamically generate a rad panel bar -->
                            <div style="margin: 10px;max-height: 200px; overflow:auto;">
                                <telerik:RadPanelBar runat="server" ID="rpbIncludeSections" GridLines="Horizontal" ExpandMode="MultipleExpandedItems" >
                                </telerik:RadPanelBar>
                            </div>
                             
                            <div style="margin:10px;margin-top: 30px; text-align:right;">
                                <telerik:RadButton  ID="btnPreview" runat="server" OnClick="btnPreview_OnClick"></telerik:RadButton>
                                <telerik:RadButton ID="btnSavePublish" runat="server" OnClick="btnSavePublish_OnClick"></telerik:RadButton>
                                <telerik:RadButton ID="btnPrintCV" runat="server" OnClick="btnPrintCV_OnClick"></telerik:RadButton>                                         
                            </div>
                             
                        </ItemTemplate>                     
 
                    </telerik:RadPanelItem>                   
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>

The components added dynimacally is as follows
RadPanelBar _rpbIncludeSections = (RadPanelBar)rpbResumeSectionInfo.FindControl("rpbIncludeSections");
 
            if (_personID != 0)
            {
                DataSet _Sections = _cvController.GetSectionsFromCVTemplateIDPersonID(int.Parse(e.Value), _personID);
                 
                _rpbIncludeSections.Items.Clear();
                 
                 
                foreach (DataRow _drSection in _Sections.Tables[0].Rows)
                {
                    bool _checked = false;
                    if ((_drSection["Include"].ToString() != "" && bool.Parse(_drSection["Include"].ToString()) == true) || _drSection["Persons_PersonID"].ToString() == "")
                        _checked = true;
 
 
                    RadPanelItem _panelItemLvl1 = new RadPanelItem();
                    _panelItemLvl1.Text = _drSection["CV_Section"].ToString();
                    _panelItemLvl1.Selected = true;
 
                    RadPanelItem _panelItemLvl2 = new RadPanelItem();
 
                    CheckBox _checkBox = new CheckBox();
                    _checkBox.ID = "Savidu";
                    _checkBox.Checked = _checked;
                    _checkBox.Text = Localization.GetString("Include.Text", this.LocalResourceFile);
                    _checkBox.ToolTip = "Check to Include in ude in CV";
                    _checkBox.CssClass = "MarginLeft";
                    _panelItemLvl2.Controls.Add(_checkBox);
 
                    _panelItemLvl1.Items.Add(_panelItemLvl2);
                    _rpbIncludeSections.Items.Add(_panelItemLvl1);
                }
            }

This part works fine the issue comes when the button "btnSavePublish" OnClick method i need to find out whether the check box is checked or not.

For this id some thing like
RadPanelBar _rpbIncludeSections = (RadPanelBar)rpbResumeSectionInfo.FindControl("rpbIncludeSections");

Through the Items attribute i am able to find the added panels. I.e since i have added 2 panels i would be able to access them

_rpbIncludeSections.Items[0].Items[0]

But, there is no way for me to access the added checkbox. I tried with the "Controls" attribute as well but it gave no luck.

Thanks Regards,
Savidu

Peter
Telerik team
 answered on 24 Jul 2012
2 answers
65 views
HI,

Ok, with some help i got to this point but found out on postback for some reason it alwyas registers my check event as as false and then i get an error in the datasource event, how can I check for it the cb_checkchanged event is true or false for checked or not in the event so that I can set the value of my hidden field to load the grid properly.

Protected Sub myRadGrid_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemCreated
      If TypeOf e.Item Is GridCommandItem Then
          Dim citem As GridCommandItem = DirectCast(e.Item, GridCommandItem)
          Dim Cb As CheckBox = DirectCast(citem.FindControl("cbhist"), CheckBox)
          If Cb.Checked = True Then
              HFHist.Value = 1
              AddHandler Cb.CheckedChanged, AddressOf cb_CheckedChanged
          Else
              HFHist.Value = Nothing
              AddHandler Cb.CheckedChanged, AddressOf cb_CheckedChanged
          End If
      End If
  End Sub
  Private Sub cb_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
      myRadGrid.Rebind()
  End Sub

Protected Sub myRadGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGrid.NeedDataSource
      Dim sqlwhere As String
      If Int32.Parse(HFHist.Value) = 1 Then
          sqlwhere = ""
      Else
          sqlwhere = "where bitJ6 IS NULL or bitJ6 = 0"
      End If
      sql = "Select f.intFlagId, f.intPersonnelid, mn.strFullname + ' ' + mn.strRank Flag, m.strFullname + ' ' + m.strRank FlagBy, CONVERT(varchar(10), dtFlagged, 101) dtFlagged, bitUnit, bitJ2, bitJ6, strNotes " _
          & "from iMAC_J2Flag f INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel mn on mn.intPersonnelId = f.intPersonnelId INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel m on m.intPersonnelId = f.intFlagBy " _
          & "" & sqlwhere & ""
      Response.Write(sql)
      Response.End()
      myRadGrid.DataSource = getData(sql)
  End Sub

Radoslav
Telerik team
 answered on 24 Jul 2012
4 answers
309 views
Team,

I have a scenario to ask for confirmation before proceeding the logic. I need to call the confirm in TextBox Changed Event at code-behind (C#).

CS
RadAjaxManager1.ResponseScripts.Add("radconfirm('Are you sure!?', confirmCallBackFn);");

How can i get the result value if I press Yes or No, need some sample script.

Mohan
Top achievements
Rank 1
 answered on 24 Jul 2012
2 answers
70 views
I need to have 2 refresh button in the Radgrid.On clicking one Refresh button I need to show a set of data in the grid and on clicking the other refresh button,need to show another set of data.
How can I accomplish this by giving 2 refresh buttons in the radGrid.?

Also ,in the Grid,I have given filter with below properties in one of my column 'Name'.
"AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains""
If I enter a name and press enter,records with given name is fetched.But if I remove the name and click on refresh button,the grid is not refreshed with whole data.It is showing the 1 record with that name itself.Can I refresh the Grid as in normal case/

Please help me on the above two issues.
Thanks,
Soumya.


Radoslav
Telerik team
 answered on 24 Jul 2012
3 answers
1.8K+ views
Hi there..

Normally we have English letter keyboards with other languages support. And we can switch between languages by pressing Alt-Shift or Ctrl-Shift, or by selecting the input language from the language bar, and then we can start typing in the selected language.

Currently I am developing a web page where the user should fill some fields in two languages (i.e., filling name in English letters and then filling name in Arabic letters). Normally in this case, the user should fill the name in English and then switch the keyboard language from the keyboard or the language bar.


I want to restrict the input the Arabic text box to accept only Arabic , put also you can pest arabic word,,
I am using ASP.NET AJAX Q1 2012 ..

is there any way in Rad Control to do that?

Thanks..
Eyup
Telerik team
 answered on 24 Jul 2012
3 answers
122 views
hi Everybody,
I am exporting radgrid into pdf. But on the same time, I want to add an jpg image into same pdf, by converting into bytes. In debugging it is showing all total bytes into newarr, and even it adds same total kbs into resultset pdf file, but it does not show that additional image into result pdf file. Please do help me.

MemoryStream chartStream;// it contain image in chartStream on button click and after button click execute RadGrid1_GridExporting.
protected void RadGrid1_GridExporting(object source, GridExportingArgs e)
        {
            using (FileStream fs = File.Create(FILEPATH))
            {
                byte[] chartbytes = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
                byte[] imagebytes = chartStream.ToArray();
                byte[] newarr;
                newarr = chartbytes.Concat(imagebytes).ToArray();
                fs.Write(newarr, 0, newarr.Length);
            }
        }
Daniel
Telerik team
 answered on 24 Jul 2012
7 answers
1.2K+ views
I've been getting this error "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control" on all of my combos since I upgraded to Q1 2010 version, is there any reason for that?
 
Nicolaï
Top achievements
Rank 2
 answered on 24 Jul 2012
3 answers
118 views
Hi Telerik,
When I resize the tree pane width, grid of file explorer auto resize (file attachment).
Please help me fix bugs, thanks you so much.

This code :
<telerik:RadFileExplorer runat="server" ID="FileExplorer1" Configuration-MaxUploadFileSize="100000000" OnItemCommand="FileExplorer1_ItemCommand"
    VisibleControls="Toolbar,ContextMenus,TreeView,Grid" Width="520px" Height="520px"
    EnableCreateNewFolder="true" EnableOpenFile="true">
</telerik:RadFileExplorer>

Rohan
Top achievements
Rank 1
 answered on 24 Jul 2012
0 answers
55 views
hello.. i am using RadAsyncUpload to upload my client files i want 2 check if the current uploaded file size is larger then the maximum allowed file size i want 2 display my validation label without making that file appear in the progress area like appearing in the second image
Bassem
Top achievements
Rank 1
 asked on 24 Jul 2012
2 answers
52 views
Hi everybody!
I have a problem about edit in radgrid. I do example http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editmodes/defaultcs.aspx#  When I click update, data in grid is changed but grid is not normal (editmode of this row is inplace). Although, when I click cancel, grid is normal (this row is normal).
Have you any idea! Thanks you!
Pham
Top achievements
Rank 1
 answered on 24 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?