Click here to Skip to main content
15,897,704 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDisable a Cell like a Button Pin
Vimalsoft(Pty) Ltd25-Feb-09 2:47
professionalVimalsoft(Pty) Ltd25-Feb-09 2:47 
AnswerRe: Disable a Cell like a Button Pin
N a v a n e e t h25-Feb-09 2:59
N a v a n e e t h25-Feb-09 2:59 
GeneralRe: Disable a Cell like a Button Pin
Vimalsoft(Pty) Ltd25-Feb-09 3:02
professionalVimalsoft(Pty) Ltd25-Feb-09 3:02 
GeneralRe: Disable a Cell like a Button Pin
N a v a n e e t h25-Feb-09 3:19
N a v a n e e t h25-Feb-09 3:19 
AnswerRe: Disable a Cell like a Button Pin
Jörgen Andersson25-Feb-09 4:01
professionalJörgen Andersson25-Feb-09 4:01 
GeneralRe: Disable a Cell like a Button Pin
Vimalsoft(Pty) Ltd25-Feb-09 4:08
professionalVimalsoft(Pty) Ltd25-Feb-09 4:08 
GeneralRe: Disable a Cell like a Button Pin
Jörgen Andersson25-Feb-09 4:15
professionalJörgen Andersson25-Feb-09 4:15 
GeneralRe: Disable a Cell like a Button Pin
Vimalsoft(Pty) Ltd25-Feb-09 21:52
professionalVimalsoft(Pty) Ltd25-Feb-09 21:52 
Its an Honor to be helped by you guys. Thank you for being there. i think am at the end of my Problem, This is the method that setup the Grid.
protected void setupGrid()
    {
        if (((int)Session["numCycles"]) > 0)
        {
            UltraWebGrid cycleGrid = ultraGridCycles;
            int numCols = 0;
            int numRows = 0;

            if (((int)Session["numCycles"]) >= 13)
            {
                numCols = 13;
            }
            else
            {
                numCols = ((int)Session["numCycles"]);
            }

            if ((((int)Session["numCycles"]) % 13) == 0)
            {
                numRows = (int)(((int)Session["numCycles"]) / 13);
            }
            else
            {
                numRows = (int)((((int)Session["numCycles"]) / 13) + 1);
            }

            cycleGrid.Height = Unit.Pixel(20 * numRows + 6);

            for (int i = 0; i < numCols; i++)
            {
                UltraGridColumn col = new UltraGridColumn(true);
                col.Width = Unit.Pixel(10);
                col.Key = i.ToString();
                cycleGrid.Columns.Add(col);
            }

            for (int i = 1; i <= numRows; i++)
            {
                UltraGridRow row = new UltraGridRow(true);

                row.Key = i.ToString();
                
                for (int j = 1; j <= numCols; j++)
                {
                    UltraGridCell cell = new UltraGridCell(true);
                    cell.Style.HorizontalAlign = HorizontalAlign.Center;
                    cell.Style.Padding.Left = 0;
                    cell.Style.Padding.Top = 0;
                    cell.Style.Padding.Bottom = 0;
                    cell.Style.Padding.Right = 0;
                    cell.Value = (int)((13 * (i - 1)) + j);
              
                     
                   if (((13 * (i - 1)) + j) > ((int)Session["numCycles"]))
                   {
                        cell.Value = null;
                   }

                    UltraGridCell Cell = new UltraGridCell(true);

                    row.Cells.Add(cell);

                    ArrayList arr = (ArrayList)Disable_Grid();

                    foreach (String s in arr)
                    {
                        row.Cells.RemoveAt(Convert.ToInt32(s));
                       
                    }
                }

                         
                
            }
        }
    }



Now the bolded Code is the One that will remove the Cell when it matches the variable "s". So now line

   row.Cells.RemoveAt(Convert.ToInt32(s));


remove All the the cells. At the End the Variable "s" will contain a int value of 4, but it will not remove only it, but it will remove other 3 Cells.

I want to remove only the cell with a value "4"

Thank you

Vuyiswa Maseko,

Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za

GeneralRe: Disable a Cell like a Button Pin
Vimalsoft(Pty) Ltd1-Mar-09 22:49
professionalVimalsoft(Pty) Ltd1-Mar-09 22:49 
QuestionHow the Page.IsPostBack is Working Pin
Robymon25-Feb-09 1:45
Robymon25-Feb-09 1:45 
AnswerRe: How the Page.IsPostBack is Working Pin
N a v a n e e t h25-Feb-09 1:58
N a v a n e e t h25-Feb-09 1:58 
GeneralRe: How the Page.IsPostBack is Working Pin
Robymon25-Feb-09 2:20
Robymon25-Feb-09 2:20 
GeneralRe: How the Page.IsPostBack is Working Pin
N a v a n e e t h25-Feb-09 2:58
N a v a n e e t h25-Feb-09 2:58 
GeneralRe: How the Page.IsPostBack is Working Pin
Robymon25-Feb-09 3:07
Robymon25-Feb-09 3:07 
GeneralRe: How the Page.IsPostBack is Working Pin
N a v a n e e t h25-Feb-09 3:23
N a v a n e e t h25-Feb-09 3:23 
GeneralRe: How the Page.IsPostBack is Working Pin
Xmen Real 25-Feb-09 4:51
professional Xmen Real 25-Feb-09 4:51 
GeneralRe: How the Page.IsPostBack is Working Pin
yan197725-Feb-09 3:08
yan197725-Feb-09 3:08 
Questionproblem with browser Pin
deepak baldia25-Feb-09 0:54
deepak baldia25-Feb-09 0:54 
AnswerRe: problem with browser Pin
N a v a n e e t h25-Feb-09 1:49
N a v a n e e t h25-Feb-09 1:49 
QuestionHow to Browse Folder Pin
trushitshah25-Feb-09 0:46
trushitshah25-Feb-09 0:46 
AnswerRe: How to Browse Folder Pin
N a v a n e e t h25-Feb-09 1:55
N a v a n e e t h25-Feb-09 1:55 
AnswerRe: How to Browse Folder Pin
Xmen Real 25-Feb-09 4:53
professional Xmen Real 25-Feb-09 4:53 
QuestionProblem With Datatable Pin
ais0725-Feb-09 0:46
ais0725-Feb-09 0:46 
AnswerRe: Problem With Datatable Pin
N a v a n e e t h25-Feb-09 1:56
N a v a n e e t h25-Feb-09 1:56 
Questionretrieving a sql results with a specific Id using Rank and Partition Pin
gottimukkala25-Feb-09 0:46
gottimukkala25-Feb-09 0:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.