View Complete Post
I have this code that hides a column in a gridview. (The column houses another nested gridview).
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
If e.CommandName = "Select" Then
If GridView1.Columns(0).Visible = False Then
GridView1.Columns(0).Visible = True
GridView1.Columns(0).Visible = False
The trouble is that if I click the select link on one row that action to hide is carried out on all rows. How can I set this up so that it only hides the row that is selected?
I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.
I have the following questions:
I want to apply a css class to the level 1 menu item (parent) when it or any or it's children are selected.
I've looked at MSDN documentation and any number of examples and walkthroughs but I haven't come up with a way of managing this. I was thinking something like this might work but the style is not being applied to the parent. To further complicate matters, if I try to apply a css style to StaticSelectedStyle it doesn't pick it up at all.
<StaticSelectedStyle Font-Bold="True" ForeColor="#3333CC" />
protected void MenuItemClick_NavMenu(Object sender, MenuEventArgs e)
MenuItem parentItem = e.Item.Parent;
if (parentItem != null)
parentItem.Selected = true;
I want to get the names of some folders in my drive and populate my menu control with the names of those folders.
Getting the folder names is not the issue, but how can i populate my menu with the names of getted foldernames.
I tried this:
DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("~\\MyFolders\\"));
DirectoryInfo dirs = dirInfo.GetDirectories();
Menu1.DataSource = dirs;
But im getting the error:
HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.
How can i achieve this?
Thanks in advance.
Im currently developing ecommerce web site. I reffered to some video tutorials in ASP.net website and i managed to develped basic store front for my ecommerce website. I would like give more attractive look to my categories menu using Jquery or ajax. Please someone help me to understand how to apply jquery or ajax to dynamic category menu.
I use web user control to create category menu. This is my code for that.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategoriesList.ascx.cs" Inherits="UserControls_CategoriesList" %>
<asp:DataList ID="list" runat="server" CssClass="CategoriesList" Width="200px">
Choose a Category
<HeaderStyle CssClass="CategoriesListHead" />
<asp:HyperLink ID="HyperLink1" Runat="server"
NavigateUrl='<%# Link.ToCategory(Request.QueryString["DepartmentID"], Eval("CategoryID").ToString()) %>'
Text='<%# HttpUtility.HtmlEncode(Eval("Name").ToString()) %>'
ToolTip='<%# HttpUtility.HtmlEncode(Eval("Description").ToString()) %>'