Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have one grid view
which i am binding in page load...

It showing 150 rows..

Its working fine...

.........................
But when i am adding one drop down list in one column of grid view

ASP.NET
<asp:TemplateField HeaderText="Transaction ">
<ItemTemplate>
<asp:DropDownList ID="Drop_Trans" runat="server" >
<asp:ListItem>Select Transaction Type</asp:ListItem>
<asp:ListItem>Bank Payment</asp:ListItem>
<asp:ListItem>Bank Receipt</asp:ListItem>
<asp:ListItem>Purchase Payment</asp:ListItem>
<asp:ListItem>Purchase Receipt</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>

Then after load the page... and After Display The Grid


my browser is hanging for fraction of time....
After That If i m clicking on any button also then .... Its Hanging for 2,3 second Then Processing...
I Not Getting Why its Happening...




I m not binding this Drop down with Data Base ...

I m not writing any code on page load....


I Not Want To use Paging...

If i m showing 10,20 record its working Fine...


Please Suggest Me...
Posted
Updated 8-Feb-12 2:47am
v3
Comments
thatraja 8-Feb-12 8:30am    
Show your code
dilip.aim11 8-Feb-12 8:39am    
i m sending my complete code
Tech Code Freak 8-Feb-12 8:49am    
Corrected pre tags

try to change your sql below
SQL
Select 
      [STATMENT_ID] 
      [SortCode] 
      [AccountNumber] 
      [Bank_Ref] 
      [AccountName] 
      [Currency] 
      [AccountType] 
      [BankID] 
      [BankName] 
      [Date] 
      [Narrative1] 
      [Type] 
      [Debit] 
      [Credit] 
      [isreconsile]
     From 
         TB_Santander_Bank

The Reason why it Freezing your page
Because your page is hard to specify the Fields on your Gridview
I'd suggest not to use * Asterisk when you are binding to Gridview

please vote if this will help you
thanks
 
Share this answer
 
v3
Comments
Tech Code Freak 8-Feb-12 12:10pm    
Corrected pre tags
Use PageSize property
C#
GridView1.PageSize = 200;
 
Share this answer
 
Hi now i am sending my complete Code


SQL
CREATE TABLE [dbo].[TB_Natwest_Bank](
        [STATMENT_ID] [bigint] ,
        [SortCode] [varchar](200) NULL,
        [AccountNumber] [varchar](200) NULL,
        [Bank_Ref] [varchar](200) NULL,
        [AccountName] [varchar](200) NULL,
        [Currency] [varchar](200) NULL,
        [AccountType] [varchar](200) NULL,
        [BankID] [varchar](200) NULL,
        [BankName] [varchar](200) NULL,
        [Date] [datetime] NULL,
        [Narrative1] [varchar](200) NULL,
        [Type] [varchar](200) NULL,
        [Debit] [varchar](200) NULL,
        [Credit] [varchar](200) NULL,
        [isreconsile] [bit] NULL

)



This Is Data


SQL
INSERT INTO [TB_Santander_Bank] VALUES(1,'0','122312','20120106BH855000012340','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','DIRECT DEBIT REVERSAL REF 203 BATCH 1328','252 - DEBIT REVERSAL','','9256.54',0)
INSERT INTO [TB_Santander_Bank] VALUES(2,'0','122312','20120106BH855000012341','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','DIRECT DEBIT REVERSAL REF 203 BATCH 1331','252 - DEBIT REVERSAL','','12067.61',0)
INSERT INTO [TB_Santander_Bank] VALUES(3,'0','122312','20120113BH895000012214','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 13 2012 12:00:00:000AM','DIRECT DEBIT REVERSAL REF 203 BATCH 1335','252 - DEBIT REVERSAL','','15883.88',0)
INSERT INTO [TB_Santander_Bank] VALUES(4,'0','122312','20120111BH853000012350','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 11 2012 12:00:00:000AM','DIRECT DEBIT REVERSAL REF 203 BATCH 1334','252 - DEBIT REVERSAL','','21688.59',0)
INSERT INTO [TB_Santander_Bank] VALUES(5,'0','122312','20120102BH347000017824','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  2 2012 12:00:00:000AM','INTEREST PAID AFTER TAX 0.00 DEDUCTED','399 - INDIVIDUAL OTHER/MISC CREDITS','','0.01',0)
INSERT INTO [TB_Santander_Bank] VALUES(6,'0','122312','20120111BH070000000220','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 11 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','64.8',0)
INSERT INTO [TB_Santander_Bank] VALUES(7,'0','122312','20120106BH037000042839','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','145.77',0)
INSERT INTO [TB_Santander_Bank] VALUES(8,'0','122312','20120109BH480000006526','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  9 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','260.54',0)
INSERT INTO [TB_Santander_Bank] VALUES(9,'0','122312','20120103BH044000044343','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  3 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','267.29',0)
INSERT INTO [TB_Santander_Bank] VALUES(10,'0','122312','20120110BH088000003352','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 10 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','277.38',0)
INSERT INTO [TB_Santander_Bank] VALUES(11,'0','122312','20120104BH041000031508','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  4 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','331.07',0)
INSERT INTO [TB_Santander_Bank] VALUES(12,'0','122312','20120105BH047000004470','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','373',0)
INSERT INTO [TB_Santander_Bank] VALUES(13,'0','122312','20120105BH047000004471','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','439.35',0)
INSERT INTO [TB_Santander_Bank] VALUES(14,'0','122312','20120105BH047000004472','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','BANK GIRO CREDIT REF CARDNET 503818486','923 - BANK TRANSFER - CREDIT','','1077.51',0)
INSERT INTO [TB_Santander_Bank] VALUES(15,'0','122312','20120105BH047000008645','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','BANK GIRO CREDIT REF 33 LTD','923 - BANK TRANSFER - CREDIT','','2327.04',0)
INSERT INTO [TB_Santander_Bank] VALUES(16,'0','122312','20120104AE001000062611','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  4 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-04','925 - DEPOSIT','','660.81',0)
INSERT INTO [TB_Santander_Bank] VALUES(17,'0','122312','20120113AE093000069605','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 13 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-13','925 - DEPOSIT','','800',0)
INSERT INTO [TB_Santander_Bank] VALUES(18,'0','122312','20120106AE333000075585','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-06','925 - DEPOSIT','','840',0)
INSERT INTO [TB_Santander_Bank] VALUES(19,'0','122312','20120112AE018000068176','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 12 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-12','925 - DEPOSIT','','1141.9',0)
INSERT INTO [TB_Santander_Bank] VALUES(20,'0','122312','20120120AE465000085233','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 20 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-20','925 - DEPOSIT','','1150',0)
INSERT INTO [TB_Santander_Bank] VALUES(21,'0','122312','20120118AE175000082933','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 18 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-18','925 - DEPOSIT','','1400.67',0)
INSERT INTO [TB_Santander_Bank] VALUES(22,'0','122312','9999','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 16 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-16','925 - DEPOSIT','','1520',0)
INSERT INTO [TB_Santander_Bank] VALUES(23,'0','122312','20120119AE235000084458','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 19 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-19','925 - DEPOSIT','','1550',0)
INSERT INTO [TB_Santander_Bank] VALUES(24,'0','122312','20120105AE797000073530','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-05','925 - DEPOSIT','','1580',0)
INSERT INTO [TB_Santander_Bank] VALUES(25,'0','122312','20120112AE504000079693','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 12 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-12','925 - DEPOSIT','','1760',0)
INSERT INTO [TB_Santander_Bank] VALUES(26,'0','122312','20120109AE399000075183','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  9 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-09','925 - DEPOSIT','','1810',0)
INSERT INTO [TB_Santander_Bank] VALUES(27,'0','122312','20120103AE394000073863','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  3 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-03','925 - DEPOSIT','','1840',0)
INSERT INTO [TB_Santander_Bank] VALUES(28,'0','122312','20120123AE001000077155','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 23 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-23','925 - DEPOSIT','','1920',0)
INSERT INTO [TB_Santander_Bank] VALUES(29,'0','122312','20120105AE605000072437','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-05','925 - DEPOSIT','','2540',0)
INSERT INTO [TB_Santander_Bank] VALUES(30,'0','122312','20120111AE899000076931','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 11 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-11','925 - DEPOSIT','','2670',0)
INSERT INTO [TB_Santander_Bank] VALUES(31,'0','122312','20120119AE679000083390','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 19 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-19','925 - DEPOSIT','','2790',0)
INSERT INTO [TB_Santander_Bank] VALUES(32,'0','122312','20120117AE050000072672','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 17 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-17','925 - DEPOSIT','','2850',0)
INSERT INTO [TB_Santander_Bank] VALUES(33,'0','122312','20120124AE144000087081','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 24 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-24','925 - DEPOSIT','','2870',0)
INSERT INTO [TB_Santander_Bank] VALUES(34,'0','122312','20120107AE749000073426','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  7 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-07','925 - DEPOSIT','','2990',0)
INSERT INTO [TB_Santander_Bank] VALUES(35,'0','122312','20120110AE098000068568','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 10 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-10','925 - DEPOSIT','','3240',0)
INSERT INTO [TB_Santander_Bank] VALUES(36,'0','122312','20120114AE211000080852','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 14 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-14','925 - DEPOSIT','','3410',0)
INSERT INTO [TB_Santander_Bank] VALUES(37,'0','122312','20120109AE626000075243','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  9 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-09','925 - DEPOSIT','','3700',0)
INSERT INTO [TB_Santander_Bank] VALUES(38,'0','122312','20120121AE160000086379','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 21 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-21','925 - DEPOSIT','','4130',0)
INSERT INTO [TB_Santander_Bank] VALUES(39,'0','122312','20120116AE819000081775','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 16 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-16','925 - DEPOSIT','','4180',0)
INSERT INTO [TB_Santander_Bank] VALUES(40,'0','122312','20120123AE271000087984','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 23 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-23','925 - DEPOSIT','','4350',0)
INSERT INTO [TB_Santander_Bank] VALUES(41,'0','122312','20120103AE600000071126','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  3 2012 12:00:00:000AM','CASH DEPOSIT AT PO  72 COUNTISBURY 2012-01-03','925 - DEPOSIT','','5810',0)
INSERT INTO [TB_Santander_Bank] VALUES(42,'0','122312','20120117BH578000000756','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 17 2012 12:00:00:000AM','CHARGES FROM 2011-12-01 TO 2011-12-31','964 - CHARGES - DEBIT','-493.17','',0)
INSERT INTO [TB_Santander_Bank] VALUES(43,'0','122312','20120111BH853000012350','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 11 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO 33 LTD REF 203 BATCH 1334','966 - DIRECT DEBIT','-21688.59','',0)
INSERT INTO [TB_Santander_Bank] VALUES(44,'0','122312','20120113BH895000012214','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 13 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO 33 LTD REF 203 BATCH 1335','966 - DIRECT DEBIT','-15883.88','',0)
INSERT INTO [TB_Santander_Bank] VALUES(45,'0','122312','20120105BH166000009330','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO 33 LTD REF 203 BATCH 1330','966 - DIRECT DEBIT','-13447.41','',0)
INSERT INTO [TB_Santander_Bank] VALUES(46,'0','122312','20120106BH855000012341','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO 33 LTD REF 203 BATCH 1331','966 - DIRECT DEBIT','-12067.61','',0)
INSERT INTO [TB_Santander_Bank] VALUES(47,'0','122312','20120106BH855000012340','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO 33 LTD REF 203 BATCH 1328','966 - DIRECT DEBIT','-9256.54','',0)
INSERT INTO [TB_Santander_Bank] VALUES(48,'0','122312','20120116BH618000004186','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 16 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO CARDNET REF SVCCHG 503818486','966 - DIRECT DEBIT','-108.24','',0)
INSERT INTO [TB_Santander_Bank] VALUES(49,'0','122312','20120118BH159000028761','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 18 2012 12:00:00:000AM','DIRECT DEBIT PAYMENT TO 33 LTD REF 203 BATCH 1337','966 - DIRECT DEBIT','-37.4','',0)
INSERT INTO [TB_Santander_Bank] VALUES(50,'0','122312','20120124IP248000001583','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 24 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 203 REFERENCE B/B203','967 - GIROBANK TRANSFER - DEBIT','-10000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(51,'0','122312','20120117IP011000001435','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 17 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 203 REFERENCE BRANCH 203','967 - GIROBANK TRANSFER - DEBIT','-10000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(52,'0','122312','20120111IP762000001468','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 11 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 & 33','967 - GIROBANK TRANSFER - DEBIT','-10000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(53,'0','122312','20120105IP905000001427','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  5 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 & 33 REFERENCE TRANSFER','967 - GIROBANK TRANSFER - DEBIT','-9000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(54,'0','122312','20120113IP646000001470','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 13 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 & 33 REFERENCE TRANSFER','967 - GIROBANK TRANSFER - DEBIT','-6000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(55,'0','122312','20120120IP777000001566','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 20 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 203 REFERENCE 203','967 - GIROBANK TRANSFER - DEBIT','-5000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(56,'0','122312','20120111IP911000001457','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 11 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 & 33 REFERENCE TRANSFER','967 - GIROBANK TRANSFER - DEBIT','-5000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(57,'0','122312','20120106IP985000001417','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan  6 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 & 33 REFERENCE TRANSFER','967 - GIROBANK TRANSFER - DEBIT','-3000','',0)
INSERT INTO [TB_Santander_Bank] VALUES(58,'0','122312','20120117IP919000001500','CA','GBP','Business Current','A&L','Alliance & Leicester','Jan 17 2012 12:00:00:000AM','BILL PAYMENT VIA FASTER PAYMENT TO 33 & 33 REFERENCE TRANSFER','967 - GIROBANK TRANSFER - DEBIT','-2000','',0)




Its MY ASPx PAGE

ASP.NET
  <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<asp:Button
        ID="Button2" runat="server" Text="Button" />



&nbsp;<asp:GridView ID="Grid_Bank_State" runat="server"  AutoGenerateColumns="False">

     <Columns>

               <asp:TemplateField HeaderText="Account ID">
                <EditItemTemplate>
                    <asp:TextBox ID="Tex33tBox1" runat="server" Text='<%# Eval("STATMENT_ID") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                 <asp:Label ID="HD_BST1" runat="server" Text='<%# Eval("STATMENT_ID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
                <asp:TemplateField HeaderText="BankReference">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox10" runat="server" Text='<%# Eval("Bank_Ref") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label8" runat="server" Text='<%# Eval("Bank_Ref") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AccountAlias">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Eval("AccountName") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("AccountName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

                <asp:TemplateField HeaderText="Type">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox18" runat="server" Text='<%# Eval("Type") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label16" runat="server" Text='<%# Eval("Type") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Date">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox12" runat="server" Text='<%# Eval("Date") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label10" runat="server" Text='<%# Eval("Date") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Description">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox13" runat="server" Text='<%# Eval("Narrative1") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label11" runat="server" Text='<%# Eval("Narrative1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>



                <asp:TemplateField HeaderText="Reciept">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Eval("Debit") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="LB_Dr_B" runat="server" Text='<%# Eval("Debit") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Payment">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Eval("Credit") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="LB_Cr_B" runat="server" Text='<%# Eval("Credit") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Select">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox_bnkk" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="BnkChkbox" onclick="SelectRow_multiple_bnk(this.id)" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>

               <asp:TemplateField HeaderText="Transaction ">
              <ItemTemplate>


                  <asp:DropDownList ID="Drop_Trans" runat="server" AutoPostBack="True"
                      >
                  <asp:ListItem Value="0">Select Transaction Type</asp:ListItem>
                  <asp:ListItem Value="1">Bank Payment</asp:ListItem>
                  <asp:ListItem Value="2">Bank Receipt</asp:ListItem>
                  <asp:ListItem Value="3">Purchase Payment</asp:ListItem>
                  <asp:ListItem Value="4">Purchase Receipt</asp:ListItem>
                  </asp:DropDownList>
                </ItemTemplate>

            </asp:TemplateField>



        </Columns>
    </asp:GridView>





and its my .cs Page


C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {


        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        DataSet ds = ProductProvider.get_Bankkkk();

        Grid_Bank_State.DataSource = ds;





        Grid_Bank_State.DataBind();
    }
}






my query is simple

SQL
Select * From TB_Santander_Bank


Now Tell Me Where i m wrong...


my data is coming in grid view... but after load the grid view my page is freez for a second...

Even after that if i am clicking on button then also first page is freezing for 2 second then event is firing....

If i remove Drop Down list From grid view ...... Its working fine.....


Please Give Me Suggestion...

i not want to use Paging...
 
Share this answer
 
v2
Comments
Tech Code Freak 8-Feb-12 8:49am    
Corrected pre tags
use
SQL
Select top 200* From TB_Santander_Bank
instead of 
 Select* From TB_Santander_Bank
 
Share this answer
 
v2
Comments
Anuja Pawar Indore 8-Feb-12 8:49am    
Added pre tag
dilip.aim11 8-Feb-12 8:52am    
hi i try all the case its not necessary that every time there 200 record ..

Some time only 100 record also there...

My problem is only why my page is freezing for 2 second...
hi,

I would said the performance issue is very likely caused by the DropDownList because the GridView is creating 200 DropDownList on button click. Try use paging to display 10, 20, 50 rows at a time. Here are few example

GridView Custom Paging[^]

http://www.tipsntracks.com/316/gridview-custom-paging-in-asp-net-3-5-with-sql-server-stored-procedure.html[^]

http://avinashkt.blogspot.com/2009/01/custom-paging-in-aspnet-gridview.html[^]

http://www.4guysfromrolla.com/articles/031506-1.aspx[^]

You also can try disabling the ViewState of the GridView and see if it make any different to the performance. Optimize the query - select only column that the application needed (but i really don't think the query is the main issue here)
 
Share this answer
 
Comments
dilip.aim11 9-Feb-12 1:28am    
Even when i am displaying 50 record then also. same problem...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900