.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

calender selecteddate search in gridview

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

very importend  !!!!!!!!!    i have a gridview with column datetime  and in this column i have datetime  allready imported on form load  from

 8:00 till 17:00

for example my datetimecolumn shows     22-5-2006 8:00

                                                            22-5-2006 8:30

how do i on calender selecteddate   search in gridview for the selecteddate

please help

View Complete Post

More Related Resource Links

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

gridview filtering using a codebehind (textbox + search button)

i am trying to replicate the following sequence: input text into text box > press search button > search a database using LIKE operator > display using a gridview or listview. this sequence is fairly easy to do using the drag and drop then sqldatasource options, but i am trying to do the same result using a codebehind.  here is my code:   ____________________________________________________________________________________________________________ SqlConnection myConn; myConn = new SqlConnection(@"Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\projectDB.mdf; Integrated Security=True;User Instance=True"); myConn.Open(); string strSQL; strSQL = "SELECT * FROM Message";       //strSQL = "SELECT * FROM Message WHERE Message LIKE '" + txtSearch.Text + "'"; SqlDataAdapter da = new SqlDataAdapter(strSQL, myConn); DataSet ds = new DataSet(); da.Fill(ds, "Message"); GridView1.DataSource = ds; GridView1.DataBind(); myConn.Close(); _____________________________________________________________________________________________________________  now, if I use this code inside a page_load event, it does work. if I put it inside a button_click event i get nothing. i am mystified by this.. any help? why can't i use a button to display my gridview1 when i'm using a code behind.  

Search for Gridview on Eventhandler

Hello, I was woundering if there is a way to seach for a gridview on event handler.? I have three gridviews in which i can insert from and on my insertbutton codebehind, I want to check the gridview i am using so i could get the datakeynames for insert into the database. Does anyone have ideas. Thaks  

search option in gridview

I am creating small application.  I want to keep textbox and gridview. If i type any alphabets in text box like customers name  if i type a it should display customers name with starting a in gridview. plz help methanq.

how to move to particular pageindex in gridview when i search

 Hi, I have one textbox one button and one gridview on my webform, when Page loads all records are displayed on gridview, which works perfectly fine, Now,I search particular records by entering id in textbox, which finds particular records and found row's background becomes red.which works perfectly fine too, my gridview's pagesize is 15 which means it display 15 records per page,   Now,Problem is when i enter ID textbox to search record,but searched record is on another page,so,I want that When i click button to search, the page must be displayed where searched record exist. It displays first page even after search, How can i move to that page where record exist.   what i have to code in click event Regards,ASIF

Using search with stored procedure and redisplaying in one gridview

I am using two SQL Data Adapters to initially populate a gridview and then repopulate from search results.  The Search SQL Data Source uses a stored procedure to retrieve the results but I cannot get the updated gridview to display. Here is my aspx code:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>All Reqeusts Data View and Editing Page</title> </head> <body> <form id="form1" runat="server"> <div> </div> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:SqlDataSource ID="AllRequestsSearchSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:artworkrequestsConnectionString %>" SelectCommand="artworksearch" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameter ControlID="BeginDat

Filtering with gridview + (search function)

      have a gridview and  6 dropdownlists which I want to use to filter data in gridview I am using this code below Try            strSql = "Select * from aspnet_Users where UserName = " & Me.DropDownList1.SelectedItem.Text            Call OpenConnection()            Call GiveCommand(strSql)            sqlMyCmd.ExecuteNonQuery()            Me.GridView1.DataSource = sqlMyCmd.ExecuteReader            Me.GridView1.DataBind()            Call EndConnect()        Catch ex As InvalidOperationException        Catch ex2 As SqlException        Catch ex As NullReferenceException        End Try what im trying to acheive on the page is to allow user to pick a value from any1 of the 6 dropdownlist (representing  6 fields) and when btnSearch is clicked Gridview displays the data the code I have above allows me to do this with one dropdown

I want to filter the gridview on textchange in search textbox....


hi friends...
i want to filter the gridview on textchange in search textbox....
if i press "a" the gridview should filled up with record starting with "a". i have some code

SqlDataSource1.SelectCommand = "select * from DeptMaster where DeptName like '" + TextBox1.Text + "%'";
        SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.Text;
        GridView1.DataSource = SqlDataSource1;

its working while leaving the textbox but i want this code should execute on keypress event....

Using search engine with GridView


Hi guys,

I'm binding database with GridView by SQLDataSource. Now if I want to search based on one of the database column (for e.g. search by date), how can I do it? 

Search an in a GridView



I would like to add a trigger to the UpdatePanel, the control is an ImageButton in a gridView like this:

                                <asp:TemplateField HeaderText="" ShowHeader="False">
                                    <%--<HeaderStyle Wrap="False" Width="25px" />--%>
                                    <ItemStyle HorizontalAlign="Left" Wrap="False" Width="25px" />
                                        <asp:ImageButton ID="imgDetalle" runat="server" CausesValidation="false" CommandName="VerDocumento"
                                            ImageUrl="~/imagesExterna/icoDetalle.gif" CommandArgument='<%# Eval("NOMBRE_DOCUMENTO") %>'
                                            ToolTip="Ver Documento" />
                                    <ItemStyle HorizontalAlign="center" Wrap="False" />

How can I add in codeBehind the trigger?? my code is this but

Search GridView and update the row that was found


 I have a gridview that populates from a sqlDataSource

I added a textBox and a button to input company name in a textBox and click the button to search. Once the row with company is found I want to update it, but when I click update in this row, the gridview displays all of the rows, and instead of the one from the search results, the first row at the top is displayed in update template.

The GridView first is populated from a static sqlDataSource (EditDistributor), that displays all of the columns in a table.

                SelectCommand="SELECT [company], [d_address], [country], [phone], Email, [ddate], [distr_id] FROM [distributors]" 
                UpdateCommand="UPDATE [distributors] SET [company] = @company, [d_address] = @d_address, [country] = @country, [phone] = @phone, Email = @email, [ddate] = @ddate WHERE [distr_id] = @distr_id">


Then in this click event I call a StoredProcedure:

Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click

        EditDistributor.SelectCommandType = SqlDataSourceCommandType.StoredProcedure

Gridview Search Error


I want to give search functionality in grid view. To implement this i am following the below link


but I am getting following error

The name 'MSCD' does not exist in the current context

Iam using the following code

if (MSCD.Utilities.Validation.IsDateTime(_newValue) == true)


                    DateTime dtValue = DateTime.Parse(_newValue);

                    _newValue = sfield + " " + _operator + " #" + dtValue.ToShortDateString() + "#";


Can anyone tell me why iam getting this error and what is the use of this MSCD.Utilities.Validation sysntax

Gridview + Search Function


Does anyone know where i can find good toturials where you can make a search function and show the results in a gridview?

Tutorials are welkom.


How to Transfer Search Result/Gridview onto a different page?


Hello Everyone,

I am new at this VB/Microsoft Visual Web Developer 2010 Express thing. I am amaze that I even got this far and thatI manages to make this search page work. Below is the code and picture for this search page. It's working. However I want to transfer the result/the gridview onto a second page Result.aspx. But I tries all kind of thing and it just doesn't seem to want to cooperate with me. If anyone can give me some hint/some sample codes on how I might be able to transfer controlfrom one page onto another. That would be greatly appreciated. And if you can please be as detail as possible - I am extremely newat this, and just have to learn it from a class extra credit project. Thank you in advance. -Also in the picture above I am using a direct connection to an Access database not the ObjectDataSource. I was just playing around with it to see which is better. But I ended up going with direct connection to Access database.



<%@ Page Language="VB" ClassName="SenderClass" EnableSessionState="True" %>


<script runat="server">

Sub closeSite(ByVal

Inplace Edit in GridView

In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend