Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
143 views

We are evaluating the Grid and will need to access the grid in an unbound fashion, adding, hiding rows, columns, etc as well as getting and setting the values of specific cells from both the client and/or server side at run time.

Is this possible?  Does anyone have a quick and easy sample of how to do this?
Veli
Telerik team
 answered on 26 Aug 2011
1 answer
167 views
This is default page code:
protected void grdFiles_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.DownloadAttachmentCommandName)
        {
            
                GridDownloadAttachmentCommandEventArgs args = e as GridDownloadAttachmentCommandEventArgs;
                string fileName = args.FileName;
                int attachmentId = (int)args.AttachmentKeyValues["ProjectFileId"];
                ProTrakEntities objEntity = new ProTrakEntities();
                ProjectFile objFile = (from type in objEntity.ProjectFiles where type.ProjectFileId == attachmentId select type).First();
                string filename = objFile.FileName;
                string Filetype = objFile.FileType;
                byte[] binaryData = (byte[])objFile.FileData;
             
                Response.Clear();
                Response.ContentType = Filetype;
                Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
                Response.BinaryWrite(binaryData);
                Response.End();
            
        }
    }

**Uploaded file Code**
 protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        if (DetailsView1.CurrentMode == DetailsViewMode.Insert)
        {
            if (Session["ProjectId"] != null)
            {
                int Projectid = Convert.ToInt32(Session["ProjectId"]);
                string Description = (DetailsView1.FindControl("RadEditor1") as RadEditor).Content;
                RadAsyncUpload radAsyncUpload = DetailsView1.FindControl("RadAsyncUpload1") as RadAsyncUpload;
                UploadedFile file = radAsyncUpload.UploadedFiles[0];
                string s = file.FileName;
                string path = System.IO.Path.GetFileName(s);
                    string Contenttype = radAsyncUpload.UploadedFiles[0].ContentType;
                int fileSize = radAsyncUpload.UploadedFiles[0].ContentLength;
                float length = float.Parse(fileSize.ToString());
                byte[] fileData = new byte[file.InputStream.Length];
                file.InputStream.Read(fileData, 0, (int)file.InputStream.Length);
                        ProTrakEntities objEntity = new ProTrakEntities();
                        ProjectFile objFile = new ProjectFile();
                        objFile.ProjectId = Projectid;
                        objFile.FileName = s;
                        objFile.FileType = Contenttype;
                        objFile.FileSize = length;
                        objFile.CreatedBy = "admin";
                        objFile.CreatedDate = DateTime.Now;
                        objFile.Description = Description;
                        objFile.FileData = fileData;
                        objEntity.AddToProjectFiles(objFile);
                        objEntity.SaveChanges();
                
            }
         }
    }
I'm saving the data in database in binaryfromat.i data was not downloading from sever when i click the attachmentcolumn.
Veli
Telerik team
 answered on 26 Aug 2011
1 answer
155 views
Hi,

I am trying to set the values for Between filter in the PreRender event of the grid..
Filter works fine if I  pass a single value (int)
column.CurrentFilterFunction = GridKnownFunction.EqualTo

 

 

 

column.CurrentFilterValue = 60


But I need to pass a range of values and use "Between" filter. Tried couple of syntaxes given below but did not work. Can you please let me know what am I doing wrong?

 

If (

 

Not Page.IsPostBack) Then

 

RadGrid1.MasterTableView.FilterExpression =

 

"([Price] between 60 AND 70) "

 

 

 

Dim column As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Price")

 

column.CurrentFilterFunction =

 

GridKnownFunction.GreaterThanOrEqualTo

 

column.CurrentFilterValue = 60

column.AndCurrentFilterFunction =

 

GridKnownFunction.LessThanOrEqualTo

 

column.AndCurrentFilterValue = 70

 

 

'column.AndCurrentFilterFunction = GridKnownFunction.Between

 

 

 

'column.CurrentFilterFunction= 60,70

 

RadGrid1.MasterTableView.Rebind()

 

 

End If

 

Princy
Top achievements
Rank 2
 answered on 26 Aug 2011
3 answers
205 views
Hello guys,

I'm facing a problem with the RadTab component on IE 9 and Mozilla 5. In the other versions of IE, its behavior is ok. Don't know about other Mozilla versions. Follows more info about the issue.

I have a RadTab and a MultiPage. RadTab is linked with the MultiPage. I want a VerticalLeft RadTab, but, in these new versions, the RadTab persists at the top of the multipage and is showing as HorizontalTab. On other versions, it is working as expected. I've tried some CSS combinations, but none of them worked as expected.

Follows the code:

 

<telerik:RadTabStrip ID="rtsVertical" runat="server" MultiPageID="rmpCourseEdit"

SelectedIndex="1" SkinID="OutlookVTAB" Style="float: left">

<Tabs>

<telerik:RadTab Text="pgvBasic" PageViewID="pgvBasic" runat="server" Selected="True" /

<telerik:RadTab Text="pgvComposite" PageViewID="pgvComposite" runat="server" />

<telerik:RadTab Text="pgvTexts" PageViewID="pgvTexts" runat="server" />

<telerik:RadTab Text="pgvPub" PageViewID="pgvPub" runat="server" />

<telerik:RadTab Text="pgvSpec" PageViewID="pgvSpecialist" runat="server" />

</Tabs>

</telerik:RadTabStrip>

<telerik:RadMultiPage ID="rmpCourseEdit" runat="server" SelectedIndex="0" RenderSelectedPageOnly="false" CssClass="MultiPageV">
... </>

Follows the CSS and Skins:
<telerik:RadTabStrip runat="server" SkinID="OutlookHTAB"

 Skin="Outlook"

 EnableEmbeddedSkins="False"

 Orientation="HorizontalTop"

 />

-------------------------

Can you help me with this guys?

tks,

 


Ivan Zhekov
Telerik team
 answered on 26 Aug 2011
1 answer
173 views
I have a grid ( radGridDocs ) when the user clicks a linkbutton in the grid (which is in the UC, DocumentAccess) the modal window pops up and the client can enter their comments. When they are finished entering their comments and click submit, the desired behavior is for the window (docComments) to close and refresh the grid. I assume this will be done via Java script, but I am new to java scripting and require a little help.

Thanks,
Chuck
Shinu
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
140 views
Update:

Telerik Please close this issue. I was able to able to fix it as suggested by Princy.

Basically, in Pre-Render event I hide the Default Expand/Collapse Column and rest I followed based on below link.


http://www.telerik.com/community/forums/aspnet-ajax/grid/gridexpandcolumn-expandimageurl-and-buttontype.aspx


Thanks Telerik and Princy.

gc_0620

___________________________________________________________________________________________

Folks using VS 2010 with RadGrid for ASP.Net Ajax 2011 V2.

I have a Hierarchical grid, Master Table HierarchyLoadMode="Client".

If use use expand/collapse Expand/Collapse ImageUrl from a File via ColumnCreated event, I got the attached error message while exporting to PDF. But If i do not call Column created event in Radgrid thus by using default Expand/Collapse ImageURL, the PDF export works fine. Also if  I use HierarchyLoadMode=Server or ServerOnDemand and call ColumnCreated event, export works fine. 
 
Any help appreciated..

Thanks

gc_0620

protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridExpandColumn)
        {
            (e.Column as GridExpandColumn).ButtonType = GridExpandColumnType.ImageButton;
  
            (e.Column as GridExpandColumn).ExpandImageUrl = "~/Images/grd_SinglePlus.gif";
            (e.Column as GridExpandColumn).CollapseImageUrl = "~/Images/grd_SingleMinus.gif";
  
        }
    }
 protected void Export_to_PDF_Click(object sender, System.EventArgs e)
    {
  
        RadGrid1.ExportSettings.ExportOnlyData = false;
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
        RadGrid1.ExportSettings.OpenInNewWindow = true;
           
        RadGrid1.MasterTableView.ExportToPdf();
    }
Princy
Top achievements
Rank 2
 answered on 26 Aug 2011
2 answers
796 views
Hi guys,
I have following code in my aspx page:

<

 

tr>

 

 

<td >

 

 

<p class="style" >

 

Please enter job posting number:

 

</p>

 

 

</td>

 

 

<td >

 

 

<telerik:RadNumericTextBox ID="JobPostingNo" runat="server" TabIndex="9" Font-Bold="true" MaxLength="4" Type="Number" MinValue="1" MaxValue="9999" CssClass="textbox" Width="48px" Enabled="false">

 

 

<NumberFormat GroupSeparator="" DecimalDigits="0" />

 

 

<DisabledStyle Font-Bold="true" BackColor="#EFEFEF" />

 

 

</telerik:RadNumericTextBox>

 

 

</td>

 

 

<td>

 

 

<asp:Image ID="JobPNErrImage" runat="server" Width="14px" Height="14px" ImageUrl="~/Image/error-icon.jpg" Visible="false" />

 

 

</td>

 

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<p class="style">

 

Have you met all of the criteria outlined in the posting?

 

</p>

 

 

</td>

 

 

<td>

 

 

<telerik:RadComboBox ID="ddlPost" runat="server" TabIndex="10" AutoPostBack="false" Font-Size="Small" Width="53px">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="Select" Value="" Selected="true" />

 

 

<telerik:RadComboBoxItem Text="Yes" Value="Y" />

 

 

<telerik:RadComboBoxItem Text="No" Value="N" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</td>

 


And here is a code behind file:

RadPanelBar

 

attestPanel = (RadPanelBar)formPanel.FindItemByValue("principalForm").FindControl("attestationPanel");

 

 

RadNumericTextBox jobPostNo = (RadNumericTextBox)attestPanel.FindItemByValue("principalattestaionInfo").FindControl("JobPostingNo");

 

 

RadComboBox ddlAprvPost = (RadComboBox)attestPanel.FindItemByValue("principalattestaionInfo").FindControl("ddlAprv");

 

 

if (ddlAprvPost.SelectedValue == "Y")

 

{

jobPostNo.Enabled =

true;

 

jobPostNo.Focus();

}

 

else

 

{

 

if (jobPostNo.Text.Length > 0)

 

{

jobPostNo.Text =

string.Empty;

 

}

jobPostNo.Enabled =

false;

 

 

}

My question is: when jobPostNo control is disabled how  to shift focus to the next control right after this control.

Thanks so much.

Vitaly
Top achievements
Rank 1
 answered on 25 Aug 2011
9 answers
857 views

I would be grateful for an example of how to wire-up some client-side javascript to the click event on a GridHyperlinkColumn. I have this markup:

 

 

 

 <MasterTableView>
 
<Columns>
 
<telerik:GridBoundColumn DataField="id" Visible="false" DataType="System.Int32"></telerik:GridBoundColumn>
 
<telerik:GridHyperlinkColumn DataTextField="companyname" DataNavigateUrlFields="companyURL" datatype="System.String">
 
</telerik:GridHyperlinkColumn>
 
</Columns>
 
</MasterTableView>

 

 

 

 

 

 

and I want to send the value of the DataNavigateUrlFields to a client-side javascript function when the hyperlink is clicked:

someClientSideFunction(  value of the DataNavigateUrlFields of the clicked item );

Thanks

vvvv
Top achievements
Rank 1
 answered on 25 Aug 2011
2 answers
441 views

Folks,

I am using ASP.Net Ajax Q2 2011 with VS 2010. Below is my Grid Table Laout.

        
        Parent Table

                                ---- Detail Table 1 (GridTableView Name = "Detail")

                                             --- Detail Table 1.1

                                ---- Detail Table 2

 
My desired expectations:

1) While I am scrolling rows in Parent Table, I would like to get the row counts of related Detail Table 1 but not row counts of other Detail Tables.

2) Also if I am scrolling rows in Detail Table 1, do nothing.
 

Below works to get the Row Count of Parent Table; but having some difficulty to getting row count of Related Detail Table 1.

function RowCount(sender, args)  
{  
   
    var grid = $find("<%=RadGrid1.ClientID %>");  
    var MasterTable = grid.get_masterTableView();  
    var Rows = MasterTable.get_dataItems();
    // Need Help here to get the Row Count of Detail Table 1 and Pass into TextBox RowCountTextBox...
    alert(Rows.length); 
    document.getElementById("<%=RowCountTextBox.ClientID %>").value = parseInt(Rows.length);
      
 }  

Rad Grid Settings:
'''

 

HierarchyLoadMode = "ServerBind"

 

'''
<ClientEvents OnFilterMenuShowing="filterMenuShowing" OnRowSelected = "RowCount" />
'''
'''
<asp:TextBox ID="RowCountTextBox" runat="server" Text="" Width = "400px"> </asp:TextBox>


I tried in Server Side Prerender event, but did not get the Child Table row count if Parent row is not expanded. 


Thanks

gc_0620
gc_0620
Top achievements
Rank 1
 answered on 25 Aug 2011
2 answers
114 views
Hello,

I have a telerik grid in which as a item template I have a checkbox..so it gets repeated at all rows..now In the header text I wanted a checkbox which if selected selects all the checkboxes on the page...can someone please tell me me how can I do that.

Thanks
JD
Top achievements
Rank 1
 answered on 25 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?