In a MVC view page, I set the data source of the Grid control.
I want to conditionally populate the cells based on the data in the server side of the view in C#. How do I populate it?
I used to do it in the ItemDataBound server side event. Is there any way I can loop throgh the datasource and declarativley define the ItemTemplate of the GridTemplateColumn? Please let me know how I can do conditional display in server side.
Thanks
<telerik:RadTextBox runat="server" ID="txtCompanyName" Text='<%#DataBinder.Eval(DataItem,"CompanyName") %>' Width="150px" TextMode="MultiLine"/>
instead of
<telerik:RadTextBox runat="server" ID="CompanyName" Text='<%#DataBinder.Eval(DataItem,"CompanyName") %>' Width="150px" TextMode="MultiLine"/>
Having a issue with getting the RadFileExplorer work with the example provided in http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/dbfilebrowsercontentprovider/defaultcs.aspx Following is the code used in my aspx file <telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" Width="750px" Height="500px"
OnClientItemSelected="OnClientItemSelected"
Skin="Sitefinity">
<Configuration ViewPaths="~/Root/Default/ViewPath" UploadPaths="~/Root/Default/UploadPath"
DeletePaths="~/Root/Default/DeletePath" />
</telerik:RadFileExplorer> I have the ViewPaths, UploadPaths and DeletePaths set up in my solution as in the attached file (fileupload.png). The table structure is modeled according to the Items table with the addition of column CreatedBy. Have the following record in the Items table ItemID:1 Name: Root ParentID: NULL MimeType: NULL IsDirectory: True Size: NULL Content: NULL upsize_ts: NULL CreatedBy: nmarker Question 1: With the above setup I am unable to upload documents, or create Directories. Check file screenshot2.png My requirement is every logged in user to my website will have their own file structure defined in the DB. Have modified DataServer.csprivate DataTable Data
{
... SqlDataAdapter adapter = new SqlDataAdapter("SELECT ItemID, [Name], ParentID, MimeType, IsDirectory, [Size]FROM rbItems where CreatedBy='" + clsUtility.getLoggedInUserName() + "' ORDER BY ItemID", Connection);
...
}public byte[] GetContent(string path)Question 2: Can all logged in users share the same physical folder structure? as in fileupload.png? or should each user have their own folder structure defined? Please advise.
{
.. SqlCommand command = new SqlCommand("SELECT Content FROM rbItems WHERE ItemID = @ItemID AND CreatedBy = @CreatedBy", Connection);
...
}
public void CreateItem(string name, string path, string mimeType, bool isDirectory, long size, byte[] content)
{
.. SqlCommand command =
new SqlCommand(
"INSERT INTO rbItems ([Name], ParentId, MimeType, IsDirectory, [Size], Content, CreatedBy) VALUES (@Name, @ParentId, @MimeType, @IsDirectory, @Size, @Content, @CreatedBy)", Connection);
...
command.Parameters.Add(new SqlParameter("@CreatedBy", clsUtility.getLoggedInUserName()));
... }
var
gridRowParent = $(".rgRow").parent;
Is this even possible.
Next I want to get the height of the gridRowParent.
Any pointers greatly appreciated.