gridview

Color Cell in one GridView based on cell value in another GridView

懵懂的女人 提交于 2019-12-13 10:08:25
问题 I am trying to color a cell in GridView1 based on a value of a cell of a GridView2. Say, " If the GridView1 Column[3] Cell value = ' ' then a GridView2 Column[0] Row.Cells.BackColor = Color.Orange; ". The following code colors the entire GridView1 and not a particular cell. protected void GridView2_OnRowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string status = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Enabled")); if (status =

Yii2 GridView filter date by year

╄→гoц情女王★ 提交于 2019-12-13 09:55:47
问题 This question is simple, but in Yii2 I cannot find the solution. Given a birthday field, how is it possible in gridview to filter by year? Typically in an index gridview. 回答1: Maybe you are looking for something like this: add in to your model public static function getYearsList() { $years = (new Query())->select('DISTINCT YEAR(`birthday`) as years')->from('{{%yourTable}}')->column(); return array_combine($years, $years); } and then in gridview [ 'attribute' => 'birthday', 'filter' =>

How to check HorizontalScrollView scroll state?

眉间皱痕 提交于 2019-12-13 09:47:05
问题 I need to access the state of scrolling in a HorizontalScrollView . How is it possible? horizontalScrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { @Override public void onScrollChanged() { // .. some code need here } }); 回答1: With scrollview you can create a customization like below, i think you can also create a custom horizontalScrollView like that? public class ScrollViewWithListener extends ScrollView{ private boolean

How to parse data from Gridview row to another page using C# and ASP.NET

折月煮酒 提交于 2019-12-13 09:39:58
问题 I would like to parse a row of data from Gridview in ASP.NET to a second page displaying contents of the row data from the previous page. My Gridview has already been linked to the database. My current Gridview looks something like this: I would like to achieve this when I click on the send details hyperlink: If I click on the second row the data from that row will display in the next page The following codes are what I had put under my link button itemTemplate: <ItemTemplate> <asp:Label ID=

Onclick Listener Gridview does not work in Fragment

蓝咒 提交于 2019-12-13 09:39:07
问题 I have 3 fragments with gridview but onclikitem event does not work. What might be the problem? I did my best and I tried all of them but not true. I think the problem is the use of fragments because with use activity works fine. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.free_video_fragment, container, false); final GridView gridview = (GridView) view.findViewById(R.id.freevideogridview); List

ListView GridView Handle ColumnsReorder

ⅰ亾dé卋堺 提交于 2019-12-13 08:45:24
问题 How to handle/persists columns reorder? Don't need to change it. Need to persist it so when the user brings up the GridView again can present the columns in order they last defined. <ListView> <ListView.View> <GridView AllowsColumnReorder="True" > 回答1: Unfortunately, you are not going to find a StoreColumnOrder="True" setting. You will have to code this up yourself. And to persist you have to store the order somewhere on disk, like a settings file. Create a new object that inherits from your

Scrolling Infinitely in android Gridview

徘徊边缘 提交于 2019-12-13 08:24:47
问题 i want to do infinite scrolling in gridview that means my scrolling in gridview never stops. it can scroll infinitely. if the scroll ends then it repeats from the first record. How can i do this? 回答1: First of all try to show what you have already done. You can do infinite scroll with MergeAdapter(CWAC) But merge adapter and GridView is not a good idea. Have you seen this link: MergeAdapter with Gridview? 来源: https://stackoverflow.com/questions/27100086/scrolling-infinitely-in-android

populating GridView with sql data

余生颓废 提交于 2019-12-13 08:15:35
问题 I need to select from my users table the username of the user that has the roleID that I will have to get from the dropdownlist. The data are not appearing in the GridView. Can't see what's wrong, help me please. Already tried 2 ways protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { SqlConnection con = new SqlConnection(cs); con.Open(); SqlCommand cmd = new SqlCommand("select username from tblUser where roleID like '" + DropDownList1.SelectedValue + "'", con);

How to get data into an EXTJS Grid Panel using json and sql

我只是一个虾纸丫 提交于 2019-12-13 07:38:38
问题 I am trying to display a gridview in extjs. That data is collected from sql db. I have a query to get the data from sql db in my GridViewController() but I am not sure on how to save those data in an array and then encode it as JSON and send the data back. my gridviewcontroller public string writeRecord() { Response.Write("Survey Completed!"); SqlConnection conn = DBTools.GetDBConnection("ApplicationServices2"); string sqlquery = "SELECT Q1, Q2, Q3, Q4, Improvements, Comments FROM myTable";

ASP + Jquery focus next textbox from Gridview

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 07:38:02
问题 I have a gridview with a table. Inside this table we have a few labels and textboxes. I am currently trying to switch from textbox to the next one when the user presses enter. For this, I am using Jquery. $(function () { var inputs = $(".mGrid").find('input:text'); inputs.each(function (index, element) { $(element).on('keyup', function (e) { e.preventDefault(); if (e.which === 13) { // alert("enter pressed"); if (index < inputs.length - 1) { var currentInput = inputs[index]; //currentInput